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:
parent
3bfbf6389e
commit
972cf64bca
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -4,10 +4,10 @@ import "image/color"
|
||||
|
||||
var (
|
||||
gopher95x128 = Image{
|
||||
Width: 95,
|
||||
Height: 128,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Width: 95,
|
||||
Height: 128,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Palette: []color.RGBA{
|
||||
{R: 255, G: 0, B: 255},
|
||||
{R: 228, G: 230, B: 227},
|
||||
|
@ -4,10 +4,10 @@ import "image/color"
|
||||
|
||||
var (
|
||||
gopher48x64 = Image{
|
||||
Width: 48,
|
||||
Height: 64,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Width: 48,
|
||||
Height: 64,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Palette: []color.RGBA{
|
||||
{R: 255, G: 0, B: 255},
|
||||
{R: 228, G: 230, B: 227},
|
||||
|
@ -4,10 +4,10 @@ import "image/color"
|
||||
|
||||
var (
|
||||
gopher71x96 = Image{
|
||||
Width: 71,
|
||||
Height: 96,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Width: 71,
|
||||
Height: 96,
|
||||
Align: AlignCenter,
|
||||
TransparentIndex: 0,
|
||||
Palette: []color.RGBA{
|
||||
{R: 255, G: 0, B: 255},
|
||||
{R: 228, G: 230, B: 227},
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user