From bdcae0e3d3c19f1f977b14a4e49c23b9093a28f2 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Jan 2024 16:18:12 -0600 Subject: [PATCH] spew Signed-off-by: Jeff Carr --- example-protobuf/Makefile | 1 + example-protobuf/main.go | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/example-protobuf/Makefile b/example-protobuf/Makefile index 15d8b54..d61c146 100644 --- a/example-protobuf/Makefile +++ b/example-protobuf/Makefile @@ -1,5 +1,6 @@ build: go build + ./example-protobuf prep: go get -v -t -u diff --git a/example-protobuf/main.go b/example-protobuf/main.go index bf40cc6..8d0c97b 100644 --- a/example-protobuf/main.go +++ b/example-protobuf/main.go @@ -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)