From bda590a39b0a873b239b41d62cabe36c75f6a87f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 21 Oct 2024 17:53:36 -0500 Subject: make clean works. configfile builds and runs Signed-off-by: Jeff Carr --- configfile/main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'configfile/main.go') diff --git a/configfile/main.go b/configfile/main.go index c012ba3..3cc713c 100644 --- a/configfile/main.go +++ b/configfile/main.go @@ -7,7 +7,8 @@ import "bufio" import "io/ioutil" import "github.com/golang/protobuf/proto" -import pb "git.wit.com/wit/virtbuf" +// import "google.golang.org/protobuf/proto" +import pb "go.wit.com/lib/protobuf/virtbuf" // // saves entries in a config file @@ -20,7 +21,7 @@ func main() { if err != nil { log.Fatalln("Error reading file:", err) } - allEvents := &pb.Event{} + allEvents := &pb.Droplet{} if err := proto.Unmarshal(in, allEvents); err != nil { log.Fatalln("Failed to parse events:", err) } @@ -30,7 +31,7 @@ func main() { log.Println(in) } -func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Event) { +func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Droplet) { buf, err := proto.Marshal(e) if err != nil { log.Fatal("marshaling error: ", err) @@ -48,7 +49,7 @@ func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Event) { func TestWriteEvent() { buf := new(bytes.Buffer) - e := pb.CreateSampleEvent() + e := pb.CreateSampleDroplet() got := buf.String() log.Println(got) @@ -61,13 +62,13 @@ func TestWriteEvent() { } func marshalUnmarshal() { - test := pb.CreateSampleEvent() + test := pb.CreateSampleDroplet() data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } - newTest := &pb.Event{} + newTest := &pb.Droplet{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err) -- cgit v1.2.3