[57] Results

Golang : Flush and close file created by os.Create and bufio.NewWriter example

golang bufio-newwriter os-create flush close-file

Whenever a new file is created by os.Create() function and data being written to the file with bufio.NewWriter(). It is….... read more


Golang : Close channel after ticker stopped example

golang close-channel new-ticker timer

This is an example on how to close channel after the time.NewTicker() function - ticker stopped. i.e close the channel….... 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 : Move file to another directory

golang move-file

So far, Go does not have a function to directly move file to different folders. We have to provide our own method to do that.….... read more


Golang : Read file with ioutil

golang read-file

This tutorial will show you how to read a file into buffer and display the content in Go. This example read plain text file, if….... 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


Golang : Check to see if *File is a file or directory

golang file directory

Sometimes, we need to write codes that is robust and flexible enough to handle different situation. For example, if a….... read more


Golang : Simple File Server

golang file-server

Got a request from a developer friend yesterday on how to open up part of his machine and turn into a file server. The code….... read more


Advertisement