From 8bf78d1cc676c3b155556fe0e47ad6d6f101c63b Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sat, 9 Dec 2023 21:08:52 -0800 Subject: [PATCH] go fmt --- apgbpal.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apgbpal.go b/apgbpal.go index cd84300..2a30e50 100644 --- a/apgbpal.go +++ b/apgbpal.go @@ -2,9 +2,9 @@ package main import ( "fmt" - "strings" "log" "os" + "strings" ) type RGBA struct { @@ -15,11 +15,11 @@ type RGBA struct { } func (c RGBA) Bytes() [4]byte { - return [4]byte {c.R, c.G, cB, c.A} + return [4]byte{c.R, c.G, cB, c.A} } func HexByteAt(str string, index int) (byte, error) { - if len(string) < index + 2 { + if len(string) < index+2 { return 0, fmt.Errorf("no hex byte at %d in too short string %q", index, str) } big, err := strconv.ParseUint(str[index:index+1], 16, 8) @@ -67,7 +67,7 @@ func (b BGPal) Bytes() [20]byte { for c := 0; c < 4; c++ { bb := b[c].Bytes() for i := 0; i < 4; i++ { - ret[3+i+4*c]=bb[i] + ret[3+i+4*c] = bb[i] } } ret[19] = '\n' @@ -100,7 +100,7 @@ func (o OBJPal) Bytes(indexchar byte) [18]byte { for c := 0; c < 3; c++ { oo := o[c].Bytes() for i := 0; i < 4; i++ { - ret[5+i+4*c]=oo[i] + ret[5+i+4*c] = oo[i] } } ret[17] = '\n' @@ -113,7 +113,7 @@ func MustParseOBJPal(strs []string) OBJPal { strs = strs[1:] } if len(strs) != 3 { - log.Fatalf("MustParseObjPal requires length 3, got %d", len(strs)) + log.Fatalf("MustParseObjPal requires length 3, got %d", len(strs)) } var ret OBJPal for i := 0; i < 3; i++ { @@ -126,7 +126,7 @@ func MustParseOBJPal(strs []string) OBJPal { } type APGBPal struct { - BG BGPal + BG BGPal OBJ0 OBJPal OBJ1 OBJPal } @@ -150,8 +150,8 @@ func main() { if err != nil { log.Fatalf("can't create test.pal: %v", err) } - aUpPal := APGBPal { - BG: MustParseBGPal([]string{"ffffff", "ff8484", "943a3a", "000000"}), + aUpPal := APGBPal{ + BG: MustParseBGPal([]string{"ffffff", "ff8484", "943a3a", "000000"}), OBJ0: MustParseObjPal([]string{"7bff31", "008400", "000000"}), OBJ1: MustParseObjPal([]string{"63a5ff", "0000ff", "000000"}), } @@ -164,4 +164,4 @@ func main() { } f.Close() os.Exit(0) -} \ No newline at end of file +}