Golang bytes.NewReader() function example
package bytes
NewReader returns a new Reader reading from the input.
Golang bytes.NewReader() function usage example
package main
import (
"bytes"
"fmt"
)
func main() {
reader := bytes.NewReader([]byte("abc"))
fmt.Println(reader.Len())
}
Output :
3
Reference :
Advertisement
Something interesting
Tutorials
+7.3k Golang : How to convert strange string to JSON with json.MarshalIndent
+6.8k Get Facebook friends working in same company
+10.2k Golang : Text file editor (accept input from screen and save to file)
+11.4k Golang : Concatenate (combine) buffer data example
+20.2k Golang : Compare floating-point numbers
+24.5k Golang : Time slice or date sort and reverse sort example
+10.9k Golang : Create Temporary File
+12.7k Golang : Send data to /dev/null a.k.a blackhole with ioutil.Discard
+5.3k PHP : Hide PHP version information from curl
+17.7k How to enable MariaDB/MySQL logs ?
+10.3k Golang : Detect number of faces or vehicles in a photo
+5.3k Python : Convert(cast) string to bytes example