[57] Results

Golang : How to stream file to client(browser) or write to http.ResponseWriter?

golang stream-file browser client

Problem :

You have a file - such as a PDF or MP3 file that you want to stream/download straight….... 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 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 : 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


Golang : Save(pipe) HTTP response into a file

golang http file

Problem :

You want to save or pipe a website content via http.Get() function to a file for processing.

Solution….... read more


Golang : Create Temporary File

golangfile I/O

Need to create a temporary file in Go? Easy. Below is the code in Go for creating a temporary file package main import ( "fmt"….... read more


Advertisement