I am looking to convert a string array to a byte array in GO so I can write it down to a disk. What is an optimal solution to encode and decode a string array ([]string
[]string
You can do something like this:
var lines = []string var ctx = []byte{} for _, s := range lines { ctx = append(ctx, []byte(s)...) }