[8] Results

Golang : Convert(cast) bytes.Buffer or bytes.NewBuffer type to io.Reader

golang bytes-buffer io-reader convert-cast

Problem :

You need to convert or type cast bytes.Buffer or bytes.NewBuffer type to io.Reader to use in io.MultiReader() function….... read more


Golang : Convert(cast) io.Reader type to string

golang convert type-cast io-reader string

Problem :

You have input of type io.Reader and you need to convert the input to string type.

Solution :

.... read more


Golang : Skip blank/empty lines in CSV file and trim whitespaces example

golang csv trim-whitespaces reader fieldsPerRecord TrimLeadingSpace

Problem:

Your Golang program is reading from a CSV file and you want to skip blank lines in the CSV….... read more


Golang : Convert(cast) []byte to io.Reader type

golang convert cast byte io-reader

Problem :

Need to convert XML data from http.Get() to io.Reader type for xml.NewDecoder() function to work . How to….... read more


Golang : Simple file scaning and remove virus example

file-scanning anti-virus bytes-reader strings-index signature

Just for fun, for this tutorial, we will simulate a simple anti-virus program. Let's create a simple file scanner that….... read more


Golang : Read large file with bufio.Scanner cause token too long error

golang token-too-long bufio-scanner bufio-reader

There are couple of ways to read files with Golang and one of the common way to read in file….... read more


Golang : Reset or rewind io.Reader or io.Writer

golang io-reader io-writer seek panic-runtime-error invalid-memory nil-pointer-dereference

Problem :

You have read file with io.Reader till EOF. Or you want to rewrite a file with io.Writer again.….... read more


Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference

golang reset-io-reader panic-runtime-error invalid-memory nil-pointer-dereference

Problem :

You read a file to retrieve some data with io.Reader, then when you attempt to read the same….... read more


Advertisement