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

View File

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

View File

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

View File

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

View File

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

View File

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