Why can’t I append string to byte slice as the Go reference specified?

You need to use “…” as suffix in order to append a slice to another slice.
Like this:

package main
import "fmt"

func main(){
    a := []byte("hello")
    s := "world"
    a = append(a, s...) // use "..." as suffice 
    fmt.Printf("%s",a)
}

You could try it here: http://play.golang.org/p/y_v5To1kiD

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)