File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed
Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2121go.work
2222.idea /
2323
24+ dist /
Original file line number Diff line number Diff line change 88 env :
99 - CGO_ENABLED=0
1010 ldflags :
11- - -s
11+ - -s -X main.version={{ .Version }}
1212 goos :
1313 - linux
1414 - darwin
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module github.com/pubg/protoc-gen-debug
22
33go 1.20
44
5- require google.golang.org/protobuf v1.31.1-0.20230727123859-6d0a5dbd9500 // indirect
5+ require google.golang.org/protobuf v1.31.1-0.20230727123859-6d0a5dbd9500
Original file line number Diff line number Diff line change 11github.com/golang/protobuf v1.5.0 /go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk =
2+ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU =
23github.com/google/go-cmp v0.5.5 /go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE =
4+ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4 =
35golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 /go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0 =
46google.golang.org/protobuf v1.26.0-rc.1 /go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw =
5- google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8 =
6- google.golang.org/protobuf v1.31.0 /go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I =
77google.golang.org/protobuf v1.31.1-0.20230727123859-6d0a5dbd9500 h1:7y2/WECm0zxQchjsPsWLAajGJ77KApK/0JpIaBOeDvk =
88google.golang.org/protobuf v1.31.1-0.20230727123859-6d0a5dbd9500 /go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I =
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package main
22
33import (
44 "flag"
5+ "fmt"
6+ "os"
57 "strings"
68
79 "google.golang.org/protobuf/compiler/protogen"
@@ -21,7 +23,19 @@ type PluginOptions struct {
2123 Parameter string
2224}
2325
26+ var version string = "develop"
27+
2428func main () {
29+ if len (os .Args ) == 2 {
30+ if os .Args [1 ] == "--version" {
31+ fmt .Println (version )
32+ } else if os .Args [1 ] == "--help" {
33+ fmt .Println ("USAGE:" )
34+ fmt .Println (" protoc-gen-debug --version : print version" )
35+ }
36+ return
37+ }
38+
2539 var flags flag.FlagSet
2640 opts := protogen.Options {
2741 ParamFunc : flags .Set ,
You can’t perform that action at this time.
0 commit comments