diff options
Diffstat (limited to 'configfile/main.go')
| -rw-r--r-- | configfile/main.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/configfile/main.go b/configfile/main.go index 727559d..bbd2c70 100644 --- a/configfile/main.go +++ b/configfile/main.go @@ -32,8 +32,8 @@ func main() { } } -func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Cluster) { - buf, err := proto.Marshal(e) +func marshalWriteToFile(myWriter *bufio.Writer, c *pb.Cluster) { + buf, err := proto.Marshal(c) if err != nil { log.Fatal("marshaling error: ", err) } @@ -41,7 +41,7 @@ func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Cluster) { myWriter.Flush() log.Println("bufio.Write() tmp, err = ", tmp, err) - buf, err = proto.Marshal(e) + buf, err = proto.Marshal(c) tmp2, err := myWriter.Write(buf) myWriter.Flush() log.Println("bufio.Write() tmp2, err = ", tmp2, err) @@ -50,26 +50,26 @@ func marshalWriteToFile(myWriter *bufio.Writer, e *pb.Cluster) { func TestWriteDroplet() { buf := new(bytes.Buffer) - e := pb.CreateSampleCluster(10) + c := pb.CreateSampleCluster(3) got := buf.String() log.Println(got) newfile, _ := os.Create("/tmp/testing4.protobuf") myWriter := bufio.NewWriter(newfile) - marshalWriteToFile(myWriter, e) + marshalWriteToFile(myWriter, c) marshalUnmarshal() } func marshalUnmarshal() { - test := pb.CreateSampleCluster(10) + test := pb.CreateSampleCluster(7) data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } - newTest := &pb.Droplet{} + newTest := &pb.Cluster{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err) |
