Golang encode []string to []byte
If you want to encode a []string into a []byte
func encodeString (data []string) []byte {
buffer := &bytes.Buffer{}
gob.NewEncoder(buffer).Encode(data)
byteSlice := buffer.Bytes()
fmt.Printf("%q\n", byteSlice)
fmt.Println("---------------------------")
return byteSlice
}

