[39] Results

Golang : Get all local users and print out their home directory, description and group id

golang home-directory os-user local-user-list

In this short tutorial, we will explore how to get a list of users from the local machine and iterate….... read more

Golang : How to get a user home directory path?

golang home-directory os-user lookup-username

Problem :

You need to get a user's home directory path in a Unix/Linux machine for storing or processing customized….... read more

Golang : Get and Set User-Agent examples

golang user-agent

Problem :

You want to detect User-Agent of your web application users and also setup your own User-Agent name for….... read more

Golang : How to determine if user agent is a mobile device example

golang robot crawler user-agent

With the increasing number of people accessing the Internet with mobile devices such as tablet or smart phone apart from….... read more

Golang : Read directory content with filepath.Walk()

golang os

Golang's filepath.Walk function allow a program to traverse a directory content and tree with ease. In this tutorial, we will see how to read a….... read more

Golang : Read directory content with os.Open

golang os

There are few ways to traverse a directory tree and content in Go. One of them is os.File.Readdir function. In this tutorial, we will see….... read more

Golang : Removes punctuation or defined delimiter from the user's input

golang remove punctuation delimeter user-input

Problem :

You need to clean up your user's input from punctuation or certain delimiter defined by you. For example,….... read more

Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type

golang os-signal interrupt ctrl-c os-kill

Problem :

Your server needs to perform some clean up operation or flush everything in memory to disk before shutting….... read more