Tuesday, 12 April 2016

how to []byte to string in golang?

1) print formatted string,  byte array

fmt.Printf("%s\n",body)


2) byte array to string

buff := bytes.NewBuffer(body)
fmt.Println(buff.String())




No comments:

Post a Comment