diff options
| author | Jeff Carr <[email protected]> | 2024-10-21 17:53:36 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-21 17:53:36 -0500 |
| commit | bda590a39b0a873b239b41d62cabe36c75f6a87f (patch) | |
| tree | 517f5583053fcbb303bec0bde28d93c11fb97aa4 /configfile/main.go | |
| parent | be5548cd4e24addacd8a7cfa8c61c2fad5ccbd65 (diff) | |
make clean works. configfile builds and runs
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'configfile/main.go')
| -rw-r--r-- | configfile/main.go | 13 |
1 files changed, 7 insertions, 6 deletions
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) |
