go fmt compliance fixes

This commit is contained in:
Garrett D'Amore 2023-08-14 18:27:44 -07:00
parent b187e6250e
commit 8b8ed1d164
15 changed files with 39 additions and 33 deletions

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The TCell Authors
@ -46,7 +47,7 @@ func makebox(s tcell.Screen) {
rgb := tcell.NewHexColor(int32(rand.Int() & 0xffffff))
st = st.Background(rgb)
} else if s.Colors() > 1 {
st = st.Background(tcell.Color(rand.Int() % s.Colors()) | tcell.ColorValid)
st = st.Background(tcell.Color(rand.Int()%s.Colors()) | tcell.ColorValid)
} else {
st = st.Reverse(rand.Int()%2 == 0)
gl = glyphs[rand.Int()%len(glyphs)]

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2020 The TCell Authors

View File

@ -290,7 +290,7 @@ func main() {
switch ev.Buttons() {
case tcell.ButtonNone:
if ox >= 0 {
bg := theme[(lchar-'0') % 8]
bg := theme[(lchar-'0')%8]
fg := tcell.ColorBlack
drawBox(s, ox, oy, x, y,
up.Background(bg).Foreground(fg),

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1217,8 +1217,7 @@ const (
modeCookedOut uint32 = 0x0001
modeVtOutput = 0x0004
modeNoAutoNL = 0x0008
// ENABLE_LVB_GRID_WORLDWIDE, needed to make underlines actually work.
modeUnderline = 0x0010
modeUnderline = 0x0010 // ENABLE_LVB_GRID_WORLDWIDE, needed for underlines
// modeWrapEOL = 0x0002
)

View File

@ -69,7 +69,6 @@ var encodingFallback EncodingFallback = EncodingFallbackFail
// The East Asian encodings have been seen to add 100-200K per encoding to the
// size of the resulting binary.
//
func RegisterEncoding(charset string, enc encoding.Encoding) {
encodingLk.Lock()
charset = strings.ToLower(charset)

View File

@ -126,5 +126,5 @@ func registerAll() {
}
func init() {
registerAll();
registerAll()
}

View File

@ -4,7 +4,7 @@
// you may not use file except in compliance with the License.
// You may obtain a copy of the license at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@ -20,8 +20,8 @@ import (
)
func ExampleRegisterEncoding() {
RegisterEncoding("GBK", simplifiedchinese.GBK);
enc := GetEncoding("GBK");
RegisterEncoding("GBK", simplifiedchinese.GBK)
enc := GetEncoding("GBK")
glyph, _ := enc.NewDecoder().Bytes([]byte{0x82, 0x74})
fmt.Println(string(glyph))
// Output: 倀

View File

@ -349,8 +349,8 @@ func (t *tScreen) prepareBracketedPaste() {
func (t *tScreen) prepareExtendedOSC() {
// Linux is a special beast - because it has a mouse entry, but does
// not swallow these OSC commands properly.
if (strings.Contains(t.ti.Name, "linux")) {
return;
if strings.Contains(t.ti.Name, "linux") {
return
}
// More stuff for limits in terminfo. This time we are applying
// the most common OSC (operating system commands). Generally

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2016 The Tcell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The Tops'l Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The Tops'l Authors

View File

@ -115,29 +115,29 @@ func (t *wScreen) SetCell(x, y int, style Style, ch ...rune) {
// via CSS.
var palette = map[Color]int32{
ColorBlack: 0x000000,
ColorMaroon: 0xcd0000,
ColorGreen: 0x00cd00,
ColorOlive: 0xcdcd00,
ColorNavy: 0x0000ee,
ColorPurple: 0xcd00cd,
ColorTeal: 0x00cdcd,
ColorSilver: 0xe5e5e5,
ColorGray: 0x7f7f7f,
ColorRed: 0xff0000,
ColorLime: 0x00ff00,
ColorYellow: 0xffff00,
ColorBlue: 0x5c5cff,
ColorBlack: 0x000000,
ColorMaroon: 0xcd0000,
ColorGreen: 0x00cd00,
ColorOlive: 0xcdcd00,
ColorNavy: 0x0000ee,
ColorPurple: 0xcd00cd,
ColorTeal: 0x00cdcd,
ColorSilver: 0xe5e5e5,
ColorGray: 0x7f7f7f,
ColorRed: 0xff0000,
ColorLime: 0x00ff00,
ColorYellow: 0xffff00,
ColorBlue: 0x5c5cff,
ColorFuchsia: 0xff00ff,
ColorAqua: 0x00ffff,
ColorWhite: 0xffffff,
ColorAqua: 0x00ffff,
ColorWhite: 0xffffff,
}
func paletteColor(c Color) int32 {
if (c.IsRGB()) {
return int32(c & 0xffffff);
if c.IsRGB() {
return int32(c & 0xffffff)
}
if (c >= ColorBlack && c <= ColorWhite) {
if c >= ColorBlack && c <= ColorWhite {
return palette[c]
}
return c.Hex()
@ -155,11 +155,11 @@ func (t *wScreen) drawCell(x, y int) int {
}
fg, bg := paletteColor(style.fg), paletteColor(style.bg)
if (fg == -1) {
fg = 0xe5e5e5;
if fg == -1 {
fg = 0xe5e5e5
}
if (bg == -1) {
bg = 0x000000;
if bg == -1 {
bg = 0x000000
}
var combcarr []interface{} = make([]interface{}, len(combc))