- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for NewBufferString (0.17 sec)
-
src/bytes/buffer_test.go
}) if n > 0 { t.Errorf("allocations occurred while shallow copying") } check(t, "NewBuffer", &buf, testString) } func TestNewBufferString(t *testing.T) { buf := NewBufferString(testString) check(t, "NewBufferString", buf, testString) } // Empty buf through repeated reads into fub. // The initial contents of buf corresponds to the string s.
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
src/bytes/example_test.go
b.Write([]byte("Hello ")) fmt.Fprintf(&b, "world!") b.WriteTo(os.Stdout) // Output: Hello world! } func ExampleBuffer_reader() { // A Buffer can turn a string or a []byte into an io.Reader. buf := bytes.NewBufferString("R29waGVycyBydWxlIQ==") dec := base64.NewDecoder(base64.StdEncoding, buf) io.Copy(os.Stdout, dec) // Output: Gophers rule! } func ExampleBuffer_Bytes() { buf := bytes.Buffer{}
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Mar 04 15:54:40 GMT 2024 - 15K bytes - Viewed (1)