#  Re: Вопрос по golang
Difrex (mira, 14) → Andrew Lobanov  –  20:25:58 2017-09-16

Вот так вот работает все
====
package main

import (
"encoding/gob"
"fmt"
"os"
)

type Count struct {
Echo string
Count int
}

func main() {
d := []Count{{"eee", 1}}
f, _ := os.Create("slice")
enc := gob.NewEncoder(f)
enc.Encode(d)
f.Close()

var c []Count
s, _ := os.Open("slice")
dec := gob.NewDecoder(s)
dec.Decode(&c)
defer s.Close()
fmt.Println(c)
}
====

====
go build
./test
[{eee 1}]

====