Original post

I have a two-dimensional map that I am trying to write on an output file using Encoding/Gob library but I am getting the following error: “gob: type not registered for interface: map[string]map[int]example1Obj”

This is the code:

This is the code:
gob.Register(map[string]interface{}{})
fileName := os.Args[1]
File, err := os.Create(fileName)
if err != nil {
log.Fatal(err)
}
defer File.Close()

enc:= gob.NewEncoder(File)

err = enc.Encode(Map.Map_1)
if err != nil {

  fmt.Print(err)
} else {

    File.Sync()
}