summaryrefslogtreecommitdiff
path: root/identify.go
blob: c84f385d6124b31ec76816a9e9d36fb05194a693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}