hotfix
This commit is contained in:
parent
88e4359cde
commit
d9e5edb3a8
|
@ -39,7 +39,7 @@ func (pb *Files) addMutex(f *File) error {
|
||||||
start := "type " + msg.Name + " struct {"
|
start := "type " + msg.Name + " struct {"
|
||||||
// marshalThing(w, msg.Name)
|
// marshalThing(w, msg.Name)
|
||||||
// log.Info("line:", line)
|
// log.Info("line:", line)
|
||||||
if strings.HasSuffix(line, start) {
|
if strings.HasPrefix(line, start) {
|
||||||
msg.MutexFound = true
|
msg.MutexFound = true
|
||||||
found = true
|
found = true
|
||||||
if argv.Mutex {
|
if argv.Mutex {
|
||||||
|
@ -53,6 +53,8 @@ func (pb *Files) addMutex(f *File) error {
|
||||||
fmt.Fprintln(w, "\t// Lock sync.RWMutex // autogenpb skipped this. needs --mutex command line arg")
|
fmt.Fprintln(w, "\t// Lock sync.RWMutex // autogenpb skipped this. needs --mutex command line arg")
|
||||||
fmt.Fprintln(w, "")
|
fmt.Fprintln(w, "")
|
||||||
}
|
}
|
||||||
|
// important to exit here. somehow this matched twice at one point. notsure how
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
|
|
15
argv.go
15
argv.go
|
@ -9,13 +9,14 @@ package main
|
||||||
var argv args
|
var argv args
|
||||||
|
|
||||||
type args struct {
|
type args struct {
|
||||||
Package string `arg:"--package" help:"the package name"`
|
Package string `arg:"--package" help:"the package name"`
|
||||||
Proto string `arg:"--proto" help:"the .proto filename"`
|
Proto string `arg:"--proto" help:"the .proto filename"`
|
||||||
Mutex bool `arg:"--mutex" default:"true" help:"insert a mutex into protoc .pb.go file"`
|
Mutex bool `arg:"--mutex" default:"true" help:"insert a mutex into protoc .pb.go file"`
|
||||||
Delete bool `arg:"--delete" help:"use delete with copy experiment"`
|
Delete bool `arg:"--delete" help:"use delete with copy experiment"`
|
||||||
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
||||||
GoSrc string `arg:"--go-src" help:"default is ~/go/src. could be set to your go.work path"`
|
GoSrc string `arg:"--go-src" help:"default is ~/go/src. could be set to your go.work path"`
|
||||||
GoPath string `arg:"--gopath" help:"the gopath of this repo"`
|
GoPath string `arg:"--gopath" help:"the gopath of this repo"`
|
||||||
|
Identify string `arg:"--identify" help:"identify file"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a args) Description() string {
|
func (a args) Description() string {
|
||||||
|
|
Loading…
Reference in New Issue