diff --git a/ebitenutil/internal/assets/assets.go b/ebitenutil/internal/assets/assets.go index d2158a7c0..e96cbd545 100644 --- a/ebitenutil/internal/assets/assets.go +++ b/ebitenutil/internal/assets/assets.go @@ -23,7 +23,7 @@ import ( const FileNameText = "text.png" //go:generate go-bindata -nocompress -pkg=assets text.png -//go:generate gofmt -w . +//go:generate gofmt -s -w . const ( TextImageWidth = 192 diff --git a/ebitenutil/internal/assets/bindata.go b/ebitenutil/internal/assets/bindata.go index 15192271a..8629eb579 100644 --- a/ebitenutil/internal/assets/bindata.go +++ b/ebitenutil/internal/assets/bindata.go @@ -143,7 +143,7 @@ type _bintree_t struct { } var _bintree = &_bintree_t{nil, map[string]*_bintree_t{ - "text.png": &_bintree_t{text_png, map[string]*_bintree_t{}}, + "text.png": {text_png, map[string]*_bintree_t{}}, }} // Restore an asset under the given directory diff --git a/examples/common/internal/assets/assets.go b/examples/common/internal/assets/assets.go index 082800056..65ca42548 100644 --- a/examples/common/internal/assets/assets.go +++ b/examples/common/internal/assets/assets.go @@ -18,4 +18,4 @@ package assets // Use -ignore as a blacklist instead. //go:generate go-bindata -nocompress -pkg=assets -ignore=\.md$ images -//go:generate gofmt -w . +//go:generate gofmt -s -w . diff --git a/examples/common/internal/assets/bindata.go b/examples/common/internal/assets/bindata.go index 62d589656..fe23b49f3 100644 --- a/examples/common/internal/assets/bindata.go +++ b/examples/common/internal/assets/bindata.go @@ -197,11 +197,11 @@ type _bintree_t struct { } var _bintree = &_bintree_t{nil, map[string]*_bintree_t{ - "images": &_bintree_t{nil, map[string]*_bintree_t{ - "arcadefont.png": &_bintree_t{images_arcadefont_png, map[string]*_bintree_t{}}, - "ebiten.png": &_bintree_t{images_ebiten_png, map[string]*_bintree_t{}}, - "fiveyears.jpg": &_bintree_t{images_fiveyears_jpg, map[string]*_bintree_t{}}, - "gophers.jpg": &_bintree_t{images_gophers_jpg, map[string]*_bintree_t{}}, + "images": {nil, map[string]*_bintree_t{ + "arcadefont.png": {images_arcadefont_png, map[string]*_bintree_t{}}, + "ebiten.png": {images_ebiten_png, map[string]*_bintree_t{}}, + "fiveyears.jpg": {images_fiveyears_jpg, map[string]*_bintree_t{}}, + "gophers.jpg": {images_gophers_jpg, map[string]*_bintree_t{}}, }}, }} diff --git a/examples/generate.go b/examples/generate.go index a392de694..d4bef74f6 100644 --- a/examples/generate.go +++ b/examples/generate.go @@ -13,6 +13,6 @@ // limitations under the License. //go:generate go run keyboard/keyboard/gen.go -//go:generate gofmt -w . +//go:generate gofmt -s -w . package example diff --git a/examples/pcm/main.go b/examples/pcm/main.go index d4496004e..cae738dde 100644 --- a/examples/pcm/main.go +++ b/examples/pcm/main.go @@ -88,7 +88,7 @@ func toBytes(l, r []int16) []byte { panic("len(l) must equal to len(r)") } b := make([]byte, len(l)*4) - for i, _ := range l { + for i := range l { b[4*i] = byte(l[i]) b[4*i+1] = byte(l[i] >> 8) b[4*i+2] = byte(r[i]) diff --git a/examples/piano/main.go b/examples/piano/main.go index c5cf5b367..d5f31181f 100644 --- a/examples/piano/main.go +++ b/examples/piano/main.go @@ -71,7 +71,7 @@ func toBytes(l, r []int16) []byte { panic("len(l) must equal to len(r)") } b := make([]byte, len(l)*4) - for i, _ := range l { + for i := range l { b[4*i] = byte(l[i]) b[4*i+1] = byte(l[i] >> 8) b[4*i+2] = byte(r[i]) diff --git a/examples/sprites/main.go b/examples/sprites/main.go index 44917fb54..b4661d74a 100644 --- a/examples/sprites/main.go +++ b/examples/sprites/main.go @@ -142,7 +142,7 @@ func main() { log.Fatal(err) } ebitenImageWidth, ebitenImageHeight = ebitenImage.Size() - for i, _ := range sprites.sprites { + for i := range sprites.sprites { w, h := ebitenImage.Size() x, y := rand.Intn(screenWidth-w), rand.Intn(screenHeight-h) vx, vy := 2*rand.Intn(2)-1, 2*rand.Intn(2)-1 diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index 68faa1171..0d20d4d70 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -42,7 +42,7 @@ var ( ) func update(screen *ebiten.Image) error { - for key, _ := range keyStates { + for key := range keyStates { if !ebiten.IsKeyPressed(key) { keyStates[key] = 0 continue diff --git a/generate.go b/generate.go index 956aec78a..2dd343790 100644 --- a/generate.go +++ b/generate.go @@ -15,4 +15,4 @@ package ebiten //go:generate go run genkeys.go -//go:generate gofmt -w . +//go:generate gofmt -s -w .