blob: b6b618329b06d75ae9dfb620df574da7408f644d [file] [log] [blame]
Test go generate as part of mechanical checks
-- go.mod --
module sketch.dev
go 1.23
-- .commit --
Initial commit
-- gen.go --
//go:build ignore
package main
import (
"os"
)
func main() {
f, _ := os.Create("generated.go")
defer f.Close()
f.WriteString("// Code generated by go generate; DO NOT EDIT.\n")
f.WriteString("package main\n")
f.WriteString("const GeneratedValue = 42\n")
}
-- main.go --
package main
//go:generate go run gen.go
func main() {
println("Hello, world!")
}
-- .commit --
Initial commit with go generate directive
-- .run_test --
# Info
The following files were changed by running `go generate`:
/PATH/TO/REPO/generated.go
Please amend your latest git commit with these changes.