diff --git a/configfile/main.go b/configfile/main.go index 0de54bb..cf4e545 100644 --- a/configfile/main.go +++ b/configfile/main.go @@ -14,24 +14,19 @@ import pb "go.wit.com/lib/protobuf/virtbuf" // func main() { - TestWriteEvent() + TestWriteDroplet() in, err := ioutil.ReadFile("/tmp/testing4.protobuf") if err != nil { log.Fatalln("Error reading file:", err) } - var allEvents pb.Droplet - if err := proto.Unmarshal(in, &allEvents); err != nil { - log.Fatalln("Failed to parse events:", err) + var aDroplet pb.Droplet + if err := proto.Unmarshal(in, &aDroplet); err != nil { + log.Fatalln("Failed to parse droplet:", err) } - // listPeople(os.Stdout, allEvents) - // got := in.String() - log.Println(allEvents) - //for i, d := range allEvents { - // log.Println("i =", i, "d =", d) - //} + log.Println(aDroplet) } func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Droplet) { @@ -49,7 +44,7 @@ func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Droplet) { log.Println("bufio.Write() tmp2, err = ", tmp2, err) } -func TestWriteEvent() { +func TestWriteDroplet() { buf := new(bytes.Buffer) e := pb.CreateSampleDroplet() diff --git a/sampleData.go b/sampleData.go index 6c48985..b75970b 100644 --- a/sampleData.go +++ b/sampleData.go @@ -26,7 +26,7 @@ func CreateSampleDroplets(total int) []Droplet { d := CreateSampleDroplet() // e.Id += 1000 + int32(i) - d.Comment = "Sample Event " + string(i) + d.Comment = "Sample Droplet " + string(i) all = append(all, *d) }