Quantcast
Channel: golang byte and string Sometimes compatible and sometimes incompatible - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Hymns For Disco for golang byte and string Sometimes compatible and...

From the appenddocumentation:As a special case, it is legal to append a string to a byte slice, like this:slice = append([]byte("hello "), "world"...)Other than this special case (and a similar case...

View Article



golang byte and string Sometimes compatible and sometimes incompatible

This is my golang codepackage testimport ("fmt""testing")func TestOne(t *testing.T) { bytes := make([]byte, 0) bytes = append(bytes, 1, 2, 3) // pass bytes = append(bytes, []byte{1, 2, 3}...) // pass...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images