[60] Results

Golang : Write file with io.WriteString

golang write-file

Writing to a file in Golang is easy. There are couple of ways to do it. In this tutorial, we will show you how to….... read more

Golang : Convert an executable file into []byte example

golang byte-conversion write-read-file c executable

This small utility program will read an executable file(or just any file) and convert the content into a []byte slice.….... read more

Golang : constant 20013 overflows byte error message

golang write-byte

Haven't been updating the tutorials portion for a while as I was busy writing up examples for Golang bytes package. While executing the bytes.Buffer.WriteByte function….... read more

Golang : Change file read or write permission example

golang write-permission read-permission change-permissions

Problem :

You have a file and you need to change a file read, write or execute permission. How to….... read more

Golang : Test file read write permission example

golang write-permission read-permission os-openfile os-ispermission

Problem :

You need to test if a file has the correct write or read permission before performing write or….... read more

Golang : Get file last modified date and time

golang file

In this tutorial, we will learn how to get a file last modified date and time with Go. Getting the last modified date and time….... read more

Golang : Output or print out JSON stream/encoded data

golang json-stream write-to-responsewriter content-type

Problem :

You need to produce JSON stream or JSON encoded data to web browser or client. How to do….... read more

Golang : get the current working directory of a running program

golang executable file-path

Problem :

You are looking for way to get the folder/directory of the running program.

Solution :

Use https://bitbucket.org/kardianos/osext.... read more