-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?

user447851
  • 163
  • 2
  • 6

1 Answers1

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.

Charlie Tumahai
  • 113,709
  • 12
  • 249
  • 242