18 lines
395 B
Go
18 lines
395 B
Go
package forgepb
|
|
|
|
import (
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
// print the protobuf in human form
|
|
func IdentifyProtobuf(data []byte) error {
|
|
var pb *Identify
|
|
pb = new(Identify)
|
|
if err := pb.Unmarshal(data); err != nil {
|
|
log.Info("data can't be identified as a standard protobuf. len =", len(data))
|
|
return err
|
|
}
|
|
log.Info("Identify protobuf file uuid =", pb.Uuid, "version =", pb.Version)
|
|
return nil
|
|
}
|