Skip to content

Commit bdb1ca9

Browse files
committed
all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Not strictly necessary but will avoid spurious changes as files are edited. Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: I30822eb504168b037ed3ec0f7759da1f41251f52 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/294374 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Jason A. Donenfeld <[email protected]>
1 parent f462b39 commit bdb1ca9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+49
-6
lines changed

app/android.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build android
56
// +build android
67

78
/*

app/app.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux || darwin || windows
56
// +build linux darwin windows
67

78
package app

app/darwin_desktop.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build darwin
6-
// +build !ios
5+
//go:build darwin && !ios
6+
// +build darwin,!ios
77

88
package app
99

app/darwin_ios.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build darwin
6-
// +build ios
5+
//go:build darwin && ios
6+
// +build darwin,ios
77

88
package app
99

app/internal/testapp/testapp.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux
56
// +build darwin linux
67

78
// Small test app used by app/app_test.go.

app/shiny.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build windows
56
// +build windows
67

78
package app

app/x11.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux && !android
56
// +build linux,!android
67

78
package app

asset/asset.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
package asset

asset/asset_darwin_armx.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin && (arm || arm64)
56
// +build darwin
67
// +build arm arm64
78

asset/asset_desktop.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (linux && !android) || (darwin && !arm && !arm64) || windows
56
// +build linux,!android darwin,!arm,!arm64 windows
67

78
package asset

cmd/gomobile/gendex.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build ignore
56
// +build ignore
67

78
// Gendex generates a dex file used by Go apps created with gomobile.

example/basic/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
// An app that draws a green triangle on a red background.

example/basic/main_x.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !darwin && !linux && !windows
56
// +build !darwin,!linux,!windows
67

78
package main

example/flappy/game.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux
56
// +build darwin linux
67

78
package main

example/flappy/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux
56
// +build darwin linux
67

78
// Flappy Gopher is a simple one-button game that uses the

example/flappy/main_x.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !darwin && !linux
56
// +build !darwin,!linux
67

78
package main

example/network/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
// An app that paints green if golang.org is reachable when the app first

example/network/main_x.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !darwin && !linux && !windows
56
// +build !darwin,!linux,!windows
67

78
package main

exp/app/debug/fps.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
// Package debug provides GL-based debugging tools for apps.

exp/audio/al/al.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
// Package al provides OpenAL Soft bindings for Go.

exp/audio/al/al_notandroid.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || (linux && !android) || windows
56
// +build darwin linux,!android windows
67

78
package al

exp/audio/al/alc.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
package al

exp/audio/al/alc_notandroid.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || (linux && !android) || windows
56
// +build darwin linux,!android windows
67

78
package al

exp/audio/al/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
package al

exp/f32/gen.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build ignore
56
// +build ignore
67

78
package main

exp/font/font.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux || darwin
56
// +build linux darwin
67

78
package font

exp/font/font_linux.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !android
56
// +build !android
67

78
package font

exp/font/font_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux || darwin
56
// +build linux darwin
67

78
package font

exp/gl/glutil/context_darwin_desktop.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build darwin
6-
// +build !ios
5+
//go:build darwin && !ios
6+
// +build darwin,!ios
77

88
package glutil
99

exp/gl/glutil/context_x11.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux && !android
56
// +build linux,!android
67

78
package glutil

exp/gl/glutil/glimage.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build linux || darwin || windows
56
// +build linux darwin windows
67

78
package glutil

exp/gl/glutil/glimage_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || (linux && !android)
56
// +build darwin linux,!android
67

78
// TODO(crawshaw): Run tests on other OSs when more contexts are supported.

exp/gl/glutil/glutil.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
package glutil // import "golang.org/x/mobile/exp/gl/glutil"

exp/sensor/android.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build android
56
// +build android
67

78
package sensor

exp/sensor/darwin_armx.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin && (arm || arm64)
56
// +build darwin
67
// +build arm arm64
78

exp/sensor/notmobile.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (linux && !android) || (darwin && !arm && !arm64) || windows
56
// +build linux,!android darwin,!arm,!arm64 windows
67

78
package sensor

exp/sprite/glsprite/glsprite.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || windows
56
// +build darwin linux windows
67

78
// Package glsprite implements a sprite Engine using OpenGL ES 2.

gl/gendebug.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build ignore
56
// +build ignore
67

78
// The gendebug program takes gl.go and generates a version of it

gl/gl.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (darwin || linux || openbsd || windows) && !gldebug
56
// +build darwin linux openbsd windows
67
// +build !gldebug
78

gl/gldebug.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gl/types_debug.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (darwin || linux || openbsd || windows) && gldebug
56
// +build darwin linux openbsd windows
67
// +build gldebug
78

gl/types_prod.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (darwin || linux || openbsd || windows) && !gldebug
56
// +build darwin linux openbsd windows
67
// +build !gldebug
78

gl/work.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin || linux || openbsd
56
// +build darwin linux openbsd
67

78
package gl

gl/work_other.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (!cgo || (!darwin && !linux && !openbsd)) && !windows
56
// +build !cgo !darwin,!linux,!openbsd
67
// +build !windows
78

internal/binres/genarsc.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mobileinit/mobileinit_ios.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build darwin && (arm || arm64)
56
// +build darwin
67
// +build arm arm64
78

0 commit comments

Comments
 (0)