Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-17 16:18:12 -06:00
parent c9ad2d3b64
commit bdcae0e3d3
2 changed files with 21 additions and 9 deletions

View File

@ -1,5 +1,6 @@
build:
go build
./example-protobuf
prep:
go get -v -t -u

View File

@ -1,14 +1,16 @@
package main
import "log"
import "bytes"
import "os"
import "bufio"
// import "io"
import "io/ioutil"
import (
"bytes"
"os"
"bufio"
"io/ioutil"
import "github.com/golang/protobuf/proto"
import pb "git.wit.com/wit/witProtobuf"
"go.wit.com/log"
"github.com/golang/protobuf/proto"
pb "go.wit.com/lib/protobuf/witProtobuf"
)
//
// writes out several files in /tmp/
@ -23,9 +25,18 @@ func main() {
}
allEvents := &pb.Event{}
if err := proto.Unmarshal(in, allEvents); err != nil {
log.Fatalln("Failed to parse events:", err)
log.Error(err, "Failed to parse events:")
}
log.SetAll(true)
log.Spew("Spew:", allEvents)
log.Spew("Spew:", allEvents.Type)
/*
for i, e := range allEvents {
log.Warn(i, e)
}
*/
// listPeople(os.Stdout, allEvents)
// got := in.String()
log.Println(in)