From ef5de6278075cf913de784de177053c576c43cc1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 8 Mar 2018 02:47:59 +0900 Subject: [PATCH] Follow the standard comment rule See https://golang.org/s/generatedcode --- ebitenutil/internal/assets/textrgba.go | 3 ++- examples/keyboard/keyboard/gen.go | 2 +- examples/keyboard/keyboard/keyrects.go | 2 +- genkeys.go | 13 +++++++------ internal/ui/keys.go | 2 +- internal/ui/keys_glfw.go | 2 +- internal/ui/keys_js.go | 2 +- keys.go | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ebitenutil/internal/assets/textrgba.go b/ebitenutil/internal/assets/textrgba.go index 310dbc7aa..d3192c5aa 100644 --- a/ebitenutil/internal/assets/textrgba.go +++ b/ebitenutil/internal/assets/textrgba.go @@ -1,4 +1,5 @@ -// DO NOT EDIT - This file is generated by file2byteslice +// Code generated by file2byteslice. DO NOT EDIT. +// (gofmt is fine after generating) package assets diff --git a/examples/keyboard/keyboard/gen.go b/examples/keyboard/keyboard/gen.go index a7e721f53..37ecdddc9 100644 --- a/examples/keyboard/keyboard/gen.go +++ b/examples/keyboard/keyboard/gen.go @@ -189,7 +189,7 @@ func outputKeyboardImage() (map[string]image.Rectangle, error) { const keyRectTmpl = `{{.License}} -// DO NOT EDIT: This file is auto-generated by gen.go. +// Code generated by gen.go using 'go generate'. DO NOT EDIT. {{.BuildTags}} diff --git a/examples/keyboard/keyboard/keyrects.go b/examples/keyboard/keyboard/keyrects.go index faaea182e..94b2dc797 100644 --- a/examples/keyboard/keyboard/keyrects.go +++ b/examples/keyboard/keyboard/keyrects.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// DO NOT EDIT: This file is auto-generated by gen.go. +// Code generated by gen.go using 'go generate'. DO NOT EDIT. // +build example diff --git a/genkeys.go b/genkeys.go index e5f6c9d9d..eb0c94c50 100644 --- a/genkeys.go +++ b/genkeys.go @@ -132,7 +132,7 @@ func init() { const ebitenKeysTmpl = `{{.License}} -// {{.Notice}} +{{.DoNotEdit}} package ebiten @@ -154,7 +154,7 @@ const ( const uiKeysTmpl = `{{.License}} -// {{.Notice}} +{{.DoNotEdit}} package ui @@ -168,7 +168,7 @@ const ( const uiKeysGlfwTmpl = `{{.License}} -// {{.Notice}} +{{.DoNotEdit}} {{.BuildTag}} @@ -192,7 +192,7 @@ var glfwKeyCodeToKey = map[glfw.Key]Key{ const uiKeysJSTmpl = `{{.License}} -// {{.Notice}} +{{.DoNotEdit}} {{.BuildTag}} @@ -295,7 +295,8 @@ func main() { log.Fatal(err) } - notice := "DO NOT EDIT: This file is auto-generated by genkeys.go." + // Follow the standard comment rule (https://golang.org/s/generatedcode). + doNotEdit := "// Code generated by genkeys.go using 'go generate'. DO NOT EDIT." namesSet := map[string]struct{}{} namesWithoutModsSet := map[string]struct{}{} @@ -350,7 +351,7 @@ func main() { // NOTE: According to godoc, maps are automatically sorted by key. if err := tmpl.Execute(f, map[string]interface{}{ "License": license, - "Notice": notice, + "DoNotEdit": doNotEdit, "BuildTag": buildTag, "NameToCodes": nameToCodes, "KeyCodeToNameEdge": keyCodeToNameEdge, diff --git a/internal/ui/keys.go b/internal/ui/keys.go index 5deca75a1..793df2a3e 100644 --- a/internal/ui/keys.go +++ b/internal/ui/keys.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// DO NOT EDIT: This file is auto-generated by genkeys.go. +// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. package ui diff --git a/internal/ui/keys_glfw.go b/internal/ui/keys_glfw.go index 1169e22cf..9371cff11 100644 --- a/internal/ui/keys_glfw.go +++ b/internal/ui/keys_glfw.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// DO NOT EDIT: This file is auto-generated by genkeys.go. +// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. // +build darwin freebsd linux windows // +build !js diff --git a/internal/ui/keys_js.go b/internal/ui/keys_js.go index b606eccde..2067a74b6 100644 --- a/internal/ui/keys_js.go +++ b/internal/ui/keys_js.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// DO NOT EDIT: This file is auto-generated by genkeys.go. +// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. // +build js diff --git a/keys.go b/keys.go index f3d8a5668..67d7071a1 100644 --- a/keys.go +++ b/keys.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// DO NOT EDIT: This file is auto-generated by genkeys.go. +// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. package ebiten