How to write CSV file in Golang

  • 21 December 2019
  • ADM

How to write CSV file in Golang using writer from encoding/csv package. For this example we took an simple example of a CSV file containing three columns name, address and phone.


How to trim whitespace from string in Golang

  • 25 September 2019
  • ADM

How to trim (remove) leading and trailing whitespace from string in Golang using the TrimSpace, Trim, TrimLeft, TrimRight methods from strings package.


How to fix apt lock-frontend error in Ubuntu

  • 24 August 2019
  • ADM

How to fix the E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) error.


How to change DNS settings from command line

  • 18 June 2019
  • ADM

The command line tool used to change the DNS settings is netsh which allows you to configure just about any aspect of your network connections in Windows. In order to use the tool the command line needs to be started as Administrator.


How to change computer's IP address from command line

  • 17 June 2019
  • ADM

The command line tool used to change the IP address is netsh which allows you to configure just about any aspect of your network connections in Windows. In order to use the tool the command line needs to be started as Administrator


How to split a string into slice in Golang

  • 15 May 2019
  • ADM

How to split a string into slice using Golang. For a simple split by a singular character you can use Split() method from strings package. For more complex rules the regexp.Split() method can be used.