From ced68020076ef3964946d2b736d717838997f62a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Jan 2024 17:45:53 -0600 Subject: [PATCH] compiles Signed-off-by: Jeff Carr --- .gitignore | 2 +- example-cmd/Makefile | 2 +- example-cmd/main.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e20a7db..5e27c76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -example-protobuf/example-protobuf +example-cmd/example-cmd *.pb.go diff --git a/example-cmd/Makefile b/example-cmd/Makefile index d61c146..3160770 100644 --- a/example-cmd/Makefile +++ b/example-cmd/Makefile @@ -1,6 +1,6 @@ build: go build - ./example-protobuf + ./example-cmd prep: go get -v -t -u diff --git a/example-cmd/main.go b/example-cmd/main.go index 8d0c97b..98efbfc 100644 --- a/example-cmd/main.go +++ b/example-cmd/main.go @@ -9,7 +9,7 @@ import ( "go.wit.com/log" "github.com/golang/protobuf/proto" - pb "go.wit.com/lib/protobuf/witProtobuf" + "go.wit.com/lib/protobuf/witpb/guipb" ) // @@ -23,7 +23,7 @@ func main() { if err != nil { log.Fatalln("Error reading file:", err) } - allEvents := &pb.Event{} + allEvents := &guipb.Event{} if err := proto.Unmarshal(in, allEvents); err != nil { log.Error(err, "Failed to parse events:") } @@ -42,7 +42,7 @@ func main() { log.Println(in) } -func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Event) { +func marshalWriteToFile(myWriter *bufio.Writer, e *guipb.Event) { buf, err := proto.Marshal(e) if err != nil { log.Fatal("marshaling error: ", err) @@ -60,7 +60,7 @@ func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Event) { func TestWriteEvent() { buf := new(bytes.Buffer) - e := pb.CreateSampleEvent() + e := guipb.CreateSampleEvent() got := buf.String() log.Println(got) @@ -73,13 +73,13 @@ func TestWriteEvent() { } func marshalUnmarshal() { - test := pb.CreateSampleEvent() + test := guipb.CreateSampleEvent() data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } - newTest := &pb.Event{} + newTest := &guipb.Event{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err)