diff --git a/_demos/beep.go b/_demos/beep.go index cf0457b..658c56e 100644 --- a/_demos/beep.go +++ b/_demos/beep.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2019 The TCell Authors diff --git a/_demos/boxes.go b/_demos/boxes.go index e974371..a889156 100644 --- a/_demos/boxes.go +++ b/_demos/boxes.go @@ -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)] diff --git a/_demos/colors.go b/_demos/colors.go index 5ebe369..e1c821b 100644 --- a/_demos/colors.go +++ b/_demos/colors.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2019 The TCell Authors diff --git a/_demos/hello_world.go b/_demos/hello_world.go index 196f0a5..fc8d5e9 100644 --- a/_demos/hello_world.go +++ b/_demos/hello_world.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2020 The TCell Authors diff --git a/_demos/mouse.go b/_demos/mouse.go index 1047678..919fd61 100644 --- a/_demos/mouse.go +++ b/_demos/mouse.go @@ -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), diff --git a/_demos/unicode.go b/_demos/unicode.go index 39144c4..246459d 100644 --- a/_demos/unicode.go +++ b/_demos/unicode.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2019 The TCell Authors diff --git a/console_win.go b/console_win.go index 97771f9..7fc9441 100644 --- a/console_win.go +++ b/console_win.go @@ -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 ) diff --git a/encoding.go b/encoding.go index 8bb449d..b7644c2 100644 --- a/encoding.go +++ b/encoding.go @@ -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) diff --git a/encoding/all.go b/encoding/all.go index a49c842..45c4cd5 100644 --- a/encoding/all.go +++ b/encoding/all.go @@ -126,5 +126,5 @@ func registerAll() { } func init() { - registerAll(); + registerAll() } diff --git a/encoding_test.go b/encoding_test.go index 757fe96..1eb9952 100644 --- a/encoding_test.go +++ b/encoding_test.go @@ -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: 倀 diff --git a/tscreen.go b/tscreen.go index 1228632..5248290 100644 --- a/tscreen.go +++ b/tscreen.go @@ -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 diff --git a/views/_demos/cellview.go b/views/_demos/cellview.go index 8e30686..2e2701f 100644 --- a/views/_demos/cellview.go +++ b/views/_demos/cellview.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2016 The Tcell Authors diff --git a/views/_demos/hbox.go b/views/_demos/hbox.go index 2d38f53..7a3b66a 100644 --- a/views/_demos/hbox.go +++ b/views/_demos/hbox.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2015 The Tops'l Authors diff --git a/views/_demos/vbox.go b/views/_demos/vbox.go index 587ca0d..5f4592f 100644 --- a/views/_demos/vbox.go +++ b/views/_demos/vbox.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // Copyright 2015 The Tops'l Authors diff --git a/wscreen.go b/wscreen.go index 308ff43..5c4fccf 100644 --- a/wscreen.go +++ b/wscreen.go @@ -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))