-2

Here is my playground where I am trying to serialize a list of structures and read back from the file.

https://play.golang.org/p/8x0uciOd1Sq

I was expecting the object to be decoded successfully. What am I doing wrong?

4

1 回答 1

1

Export the field names by capitalizing the first letter.

type REntry struct {
      Key         string
      Value       []string
 }

The gob package and other similar packages ignore unexported fields.

于 2018-02-13T00:54:09.917 回答