Converting a Byte Array to String from a Node.JS Buffer
, in Go
As noted in Converting a Byte Array to String with Buffer
in Node.JS, you may encounter serialised Buffer
s when working with Node.JS projects.
We may want to do something similar in Go, so how would we do this?
package main
import "fmt"
func main() {
a := []byte{104, 116, 116, 112, 115, 58, 47, 47, 119, 119, 119, 46, 106, 118, 116, 46, 109, 101}
fmt.Println(string(a))
//https://www.jvt.me
}