blob: b6b618329b06d75ae9dfb620df574da7408f644d [file] [log] [blame]
Josh Bleecher Snydercf191902025-06-04 18:18:40 +00001Test go generate as part of mechanical checks
2
3-- go.mod --
4module sketch.dev
5
6go 1.23
7
8-- .commit --
9Initial commit
10
11-- gen.go --
12//go:build ignore
13
14package main
15
16import (
17 "os"
18)
19
20func main() {
21 f, _ := os.Create("generated.go")
22 defer f.Close()
23 f.WriteString("// Code generated by go generate; DO NOT EDIT.\n")
24 f.WriteString("package main\n")
25 f.WriteString("const GeneratedValue = 42\n")
26}
27
28-- main.go --
29package main
30
31//go:generate go run gen.go
32
33func main() {
34 println("Hello, world!")
35}
36
37-- .commit --
38Initial commit with go generate directive
39
40-- .run_test --
41# Info
42
43The following files were changed by running `go generate`:
44
45/PATH/TO/REPO/generated.go
46
47Please amend your latest git commit with these changes.
48
49