1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

lint: fix lint warnings

This commit is contained in:
Achilleas Anagnostopoulos 2018-03-11 17:38:41 +00:00
parent 3bfbf6389e
commit 972cf64bca
9 changed files with 51 additions and 51 deletions

View File

@ -559,14 +559,14 @@ func TestParsePkgLength(t *testing.T) {
func TestParsePkgLengthErrors(t *testing.T) { func TestParsePkgLengthErrors(t *testing.T) {
specs := [][]byte{ specs := [][]byte{
// lead byte bits (6:7) indicate 1 extra byte that is missing // lead byte bits (6:7) indicate 1 extra byte that is missing
[]byte{1 << 6}, {1 << 6},
// lead byte bits (6:7) indicate 2 extra bytes with the 1st and then 2nd missing // lead byte bits (6:7) indicate 2 extra bytes with the 1st and then 2nd missing
[]byte{2 << 6}, {2 << 6},
[]byte{2 << 6, 0x1}, {2 << 6, 0x1},
// lead byte bits (6:7) indicate 3 extra bytes with the 1st and then 2nd and then 3rd missing // lead byte bits (6:7) indicate 3 extra bytes with the 1st and then 2nd and then 3rd missing
[]byte{3 << 6}, {3 << 6},
[]byte{3 << 6, 0x1}, {3 << 6, 0x1},
[]byte{3 << 6, 0x1, 0x2}, {3 << 6, 0x1, 0x2},
} }
for specIndex, spec := range specs { for specIndex, spec := range specs {
@ -580,9 +580,9 @@ func TestParsePkgLengthErrors(t *testing.T) {
func TestParseStringErrors(t *testing.T) { func TestParseStringErrors(t *testing.T) {
specs := [][]byte{ specs := [][]byte{
// Unexpected EOF before terminating null byte // Unexpected EOF before terminating null byte
[]byte{'A'}, {'A'},
// Characters outside the allowed [0x01, 0x7f] range // Characters outside the allowed [0x01, 0x7f] range
[]byte{'A', 0xba, 0xdf, 0x00}, {'A', 0xba, 0xdf, 0x00},
} }
for specIndex, spec := range specs { for specIndex, spec := range specs {

View File

@ -11,10 +11,10 @@ func TestDriverInfoListSorting(t *testing.T) {
}() }()
origlist := []*DriverInfo{ origlist := []*DriverInfo{
&DriverInfo{Order: DetectOrderACPI}, {Order: DetectOrderACPI},
&DriverInfo{Order: DetectOrderLast}, {Order: DetectOrderLast},
&DriverInfo{Order: DetectOrderBeforeACPI}, {Order: DetectOrderBeforeACPI},
&DriverInfo{Order: DetectOrderEarly}, {Order: DetectOrderEarly},
} }
for _, drv := range origlist { for _, drv := range origlist {

View File

@ -8,8 +8,8 @@ func TestFindByName(t *testing.T) {
}(availableFonts) }(availableFonts)
availableFonts = []*Font{ availableFonts = []*Font{
&Font{Name: "foo"}, {Name: "foo"},
&Font{Name: "bar"}, {Name: "bar"},
} }
exp := availableFonts[1] exp := availableFonts[1]
@ -28,10 +28,10 @@ func TestBestFit(t *testing.T) {
}(availableFonts) }(availableFonts)
availableFonts = []*Font{ availableFonts = []*Font{
&Font{Name: "retina1", RecommendedWidth: 2560, RecommendedHeight: 1600, Priority: 2}, {Name: "retina1", RecommendedWidth: 2560, RecommendedHeight: 1600, Priority: 2},
&Font{Name: "retina2", RecommendedWidth: 2560, RecommendedHeight: 1600, Priority: 1}, {Name: "retina2", RecommendedWidth: 2560, RecommendedHeight: 1600, Priority: 1},
&Font{Name: "default", RecommendedWidth: 800, RecommendedHeight: 600, Priority: 0}, {Name: "default", RecommendedWidth: 800, RecommendedHeight: 600, Priority: 0},
&Font{Name: "standard", RecommendedWidth: 1024, RecommendedHeight: 768, Priority: 0}, {Name: "standard", RecommendedWidth: 1024, RecommendedHeight: 768, Priority: 0},
} }
specs := []struct { specs := []struct {

View File

@ -4,10 +4,10 @@ import "image/color"
var ( var (
gopher95x128 = Image{ gopher95x128 = Image{
Width: 95, Width: 95,
Height: 128, Height: 128,
Align: AlignCenter, Align: AlignCenter,
TransparentIndex: 0, TransparentIndex: 0,
Palette: []color.RGBA{ Palette: []color.RGBA{
{R: 255, G: 0, B: 255}, {R: 255, G: 0, B: 255},
{R: 228, G: 230, B: 227}, {R: 228, G: 230, B: 227},

View File

@ -4,10 +4,10 @@ import "image/color"
var ( var (
gopher48x64 = Image{ gopher48x64 = Image{
Width: 48, Width: 48,
Height: 64, Height: 64,
Align: AlignCenter, Align: AlignCenter,
TransparentIndex: 0, TransparentIndex: 0,
Palette: []color.RGBA{ Palette: []color.RGBA{
{R: 255, G: 0, B: 255}, {R: 255, G: 0, B: 255},
{R: 228, G: 230, B: 227}, {R: 228, G: 230, B: 227},

View File

@ -4,10 +4,10 @@ import "image/color"
var ( var (
gopher71x96 = Image{ gopher71x96 = Image{
Width: 71, Width: 71,
Height: 96, Height: 96,
Align: AlignCenter, Align: AlignCenter,
TransparentIndex: 0, TransparentIndex: 0,
Palette: []color.RGBA{ Palette: []color.RGBA{
{R: 255, G: 0, B: 255}, {R: 255, G: 0, B: 255},
{R: 228, G: 230, B: 227}, {R: 228, G: 230, B: 227},

View File

@ -8,9 +8,9 @@ func TestBestFit(t *testing.T) {
}(availableLogos) }(availableLogos)
availableLogos = []*Image{ availableLogos = []*Image{
&Image{Height: 64}, {Height: 64},
&Image{Height: 96}, {Height: 96},
&Image{Height: 128}, {Height: 128},
} }
specs := []struct { specs := []struct {

View File

@ -517,22 +517,22 @@ func (cons *VesaFbConsole) loadDefaultPalette() {
cons.palette = make(color.Palette, 256) cons.palette = make(color.Palette, 256)
egaPalette := []color.RGBA{ egaPalette := []color.RGBA{
color.RGBA{R: 0, G: 0, B: 0}, /* black */ {R: 0, G: 0, B: 0}, /* black */
color.RGBA{R: 0, G: 0, B: 128}, /* blue */ {R: 0, G: 0, B: 128}, /* blue */
color.RGBA{R: 0, G: 128, B: 1}, /* green */ {R: 0, G: 128, B: 1}, /* green */
color.RGBA{R: 0, G: 128, B: 128}, /* cyan */ {R: 0, G: 128, B: 128}, /* cyan */
color.RGBA{R: 128, G: 0, B: 1}, /* red */ {R: 128, G: 0, B: 1}, /* red */
color.RGBA{R: 128, G: 0, B: 128}, /* magenta */ {R: 128, G: 0, B: 128}, /* magenta */
color.RGBA{R: 64, G: 64, B: 1}, /* brown */ {R: 64, G: 64, B: 1}, /* brown */
color.RGBA{R: 128, G: 128, B: 128}, /* light gray */ {R: 128, G: 128, B: 128}, /* light gray */
color.RGBA{R: 64, G: 64, B: 64}, /* dark gray */ {R: 64, G: 64, B: 64}, /* dark gray */
color.RGBA{R: 0, G: 0, B: 255}, /* light blue */ {R: 0, G: 0, B: 255}, /* light blue */
color.RGBA{R: 0, G: 255, B: 1}, /* light green */ {R: 0, G: 255, B: 1}, /* light green */
color.RGBA{R: 0, G: 255, B: 255}, /* light cyan */ {R: 0, G: 255, B: 255}, /* light cyan */
color.RGBA{R: 255, G: 0, B: 1}, /* light red */ {R: 255, G: 0, B: 1}, /* light red */
color.RGBA{R: 255, G: 0, B: 255}, /* light magenta */ {R: 255, G: 0, B: 255}, /* light magenta */
color.RGBA{R: 255, G: 255, B: 1}, /* yellow */ {R: 255, G: 255, B: 1}, /* yellow */
color.RGBA{R: 255, G: 255, B: 255}, /* white */ {R: 255, G: 255, B: 255}, /* white */
} }
// Load default EGA palette for colors 0-16 // Load default EGA palette for colors 0-16

View File

@ -1622,8 +1622,8 @@ func TestVesaFbSetLogo(t *testing.T) {
Align: logo.AlignLeft, Align: logo.AlignLeft,
TransparentIndex: 0, TransparentIndex: 0,
Palette: []color.RGBA{ Palette: []color.RGBA{
color.RGBA{R: 255, G: 0, B: 255}, {R: 255, G: 0, B: 255},
color.RGBA{R: 255, G: 0, B: 128}, {R: 255, G: 0, B: 128},
}, },
Data: []byte{ Data: []byte{
0x0, 0x1, 0x0, 0x1,