diff options
| author | Jeff Carr <[email protected]> | 2024-11-29 08:30:19 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-29 08:30:19 -0600 |
| commit | 79e73f9abf7ecec5f9623e349a22f2d7bd05a16c (patch) | |
| tree | 3add3e8c88de7b9c7796d2c2d197356eba11e3f0 /main.go | |
Day 1
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "io" + "os" +) + +func main() { + f, _ := os.OpenFile("test.sort.pb.go", os.O_WRONLY|os.O_CREATE, 0600) + header(f, "GitRefs") +} + +func header(w io.Writer, name string) { + fmt.Fprintln(w, "package gitpb") + fmt.Fprintln(w, "") + fmt.Fprintln(w, "// this is becoming a standard format") + fmt.Fprintln(w, "// todo: autogenerate this from the .proto file?") + fmt.Fprintln(w, "") + fmt.Fprintln(w, "import (") + fmt.Fprintln(w, " \"fmt\"") + fmt.Fprintln(w, " \"os\"") + fmt.Fprintln(w, " \"sort\"") + fmt.Fprintln(w, " \"sync\"") + fmt.Fprintln(w, ")") + fmt.Fprintln(w, "") + fmt.Fprintln(w, "// bad global lock until I figure out some other plan") + fmt.Fprintln(w, "var godeplock sync.RWMutex") + fmt.Fprintln(w, "") +} |
