2025-02-01 11:41:48 -06:00
|
|
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the GPL 3.0
|
|
|
|
|
2025-01-19 00:35:30 -06:00
|
|
|
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
|
|
|
|
}
|