verbage to inform someone that looks

This commit is contained in:
Jeff Carr 2025-01-09 06:05:38 -06:00
parent a4beeca857
commit 904c5b0c13
2 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,8 @@ func (pb *Files) addMutex(f *File) error {
w, _ := os.OpenFile(f.Pbfilename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) w, _ := os.OpenFile(f.Pbfilename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
pbHeaderComment(w)
lines := strings.Split(string(data), "\n") lines := strings.Split(string(data), "\n")
for _, line := range lines { for _, line := range lines {
if strings.HasPrefix(line, "package ") { if strings.HasPrefix(line, "package ") {

View File

@ -5,10 +5,22 @@ import (
"io" "io"
) )
func pbHeaderComment(w io.Writer) {
// technically this should be the first line and in this exact format:
fmt.Fprintln(w, "// Code modified by go.wit.com/apps/autogenpb. DO NOT EDIT.")
fmt.Fprintln(w, "//")
fmt.Fprintln(w, "// user defined Mutex locks were auto added")
fmt.Fprintln(w, "//")
fmt.Fprintln(w, "// autogenpb version & build time:", VERSION, BUILDTIME)
fmt.Fprintln(w, "// autogenpb auto generates Sort(), Unique() and Marshal() functions")
fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest")
fmt.Fprintln(w, "")
}
func headerComment(w io.Writer) { func headerComment(w io.Writer) {
// technically this should be the first line and in this exact format: // technically this should be the first line and in this exact format:
fmt.Fprintln(w, "// Code generated by go.wit.com/apps/autogenpb. DO NOT EDIT.") fmt.Fprintln(w, "// Code generated by go.wit.com/apps/autogenpb. DO NOT EDIT.")
fmt.Fprintln(w, "// This file was autogenerated with autogenpb", VERSION, "DO NOT EDIT") fmt.Fprintln(w, "// This file was autogenerated with autogenpb", VERSION, BUILDTIME)
fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest") fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest")
fmt.Fprintln(w, "//") fmt.Fprintln(w, "//")
fmt.Fprintln(w, "// You can use it on simple protobuf files") fmt.Fprintln(w, "// You can use it on simple protobuf files")