[60] Results

Golang : How to make a file read only and set it to writable again?

golang permission file-is-readonly writable


You want to set a file to read-only mode and also want to test if a file is really….... read more

Golang : How to validate URL the right way

golang validate-url govalidator is-url

Validating input from user or external sources is critical and needed to ensure that your program will not simply process….... read more

Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."

php fpm service-is-masked


Encounter this error message :

Failed to start php5-fpm.service: Unit php5-fpm.service is masked.

after upgrading Ubuntu with do-release-upgrade.... read more

CodeIgniter/PHP : Create directory if does not exist example

codeigniter php is-dir mkdir create-directory

Problem :

How to check if a directory exist or not? If not, how to create a directory?


.... read more

Golang : Customize scanner.Scanner to treat dash as part of identifier

golang scanner is-ident-rune unicode parser

Putting this down here for my own future reference. Ok, the problem that I'm solving today involved using the `text/scanner`….... 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