diff options
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, "") +} |
