summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..e791628
--- /dev/null
+++ b/main.go
@@ -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, "")
+}