parent
c9ad2d3b64
commit
bdcae0e3d3
|
@ -1,5 +1,6 @@
|
||||||
build:
|
build:
|
||||||
go build
|
go build
|
||||||
|
./example-protobuf
|
||||||
|
|
||||||
prep:
|
prep:
|
||||||
go get -v -t -u
|
go get -v -t -u
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "log"
|
import (
|
||||||
import "bytes"
|
"bytes"
|
||||||
import "os"
|
"os"
|
||||||
import "bufio"
|
"bufio"
|
||||||
// import "io"
|
"io/ioutil"
|
||||||
import "io/ioutil"
|
|
||||||
|
|
||||||
import "github.com/golang/protobuf/proto"
|
"go.wit.com/log"
|
||||||
import pb "git.wit.com/wit/witProtobuf"
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
pb "go.wit.com/lib/protobuf/witProtobuf"
|
||||||
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
// writes out several files in /tmp/
|
// writes out several files in /tmp/
|
||||||
|
@ -23,9 +25,18 @@ func main() {
|
||||||
}
|
}
|
||||||
allEvents := &pb.Event{}
|
allEvents := &pb.Event{}
|
||||||
if err := proto.Unmarshal(in, allEvents); err != nil {
|
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)
|
// listPeople(os.Stdout, allEvents)
|
||||||
// got := in.String()
|
// got := in.String()
|
||||||
log.Println(in)
|
log.Println(in)
|
||||||
|
|
Loading…
Reference in New Issue