diff options
| author | Jeff Carr <[email protected]> | 2025-01-19 00:35:30 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-19 00:35:30 -0600 |
| commit | ace99c8aa8ad8b95aa13d7716d8d61f38a18acdf (patch) | |
| tree | e0ba7fff195982a711cf3d1cf4b20f22d8cf828b /doIdentify.go | |
| parent | da03400035434ae9b055cb0842a3cac557d70b32 (diff) | |
add --identify
Diffstat (limited to 'doIdentify.go')
| -rw-r--r-- | doIdentify.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doIdentify.go b/doIdentify.go new file mode 100644 index 0000000..0e2ac37 --- /dev/null +++ b/doIdentify.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "go.wit.com/log" +) + +// print the protobuf in human form +func doIdentify(filename string) error { + data, err := os.ReadFile(filename) + if err != nil { + // log.Info("open config file :", err) + return err + } + + var pb *Identify + pb = new(Identify) + if err := pb.Unmarshal(data); err != nil { + return err + } + log.Info("Identify protobuf file uuid =", pb.Uuid, "version =", pb.Version) + return nil +} |
