diff --git a/addMutex.go b/addMutex.go index 8a4b0f3..082d1bc 100644 --- a/addMutex.go +++ b/addMutex.go @@ -22,7 +22,7 @@ func addMutex(names map[string]string) error { return err } - w, _ := os.OpenFile(names["protobase"]+".pb.go", os.O_WRONLY|os.O_CREATE, 0600) + w, _ := os.OpenFile(names["protobase"]+".pb.go", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) var found bool diff --git a/marshal.go b/marshal.go index 91ea414..7585a6d 100644 --- a/marshal.go +++ b/marshal.go @@ -17,7 +17,7 @@ func marshal(names map[string]string) { os.Exit(0) } - w, _ := os.OpenFile(names["protobase"]+".marshal.pb.go", os.O_WRONLY|os.O_CREATE, 0600) + w, _ := os.OpenFile(names["protobase"]+".marshal.pb.go", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) fmt.Fprintln(w, "package "+names["package"]) headerComment(w) diff --git a/sort.go b/sort.go index a816f9f..70e912d 100644 --- a/sort.go +++ b/sort.go @@ -8,7 +8,7 @@ import ( ) func makeSortfile() { - f, _ := os.OpenFile(sortmap["protobase"]+".sort.pb.go", os.O_WRONLY|os.O_CREATE, 0600) + f, _ := os.OpenFile(sortmap["protobase"]+".sort.pb.go", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) header(f, sortmap)