Maps in Golang
Golang maps implements a hash table. Hash tables are one of the most used data structure. A hash table is an unordered collection of key-value pairs, where each key is unique.
Arrays in Golang
An array is a data structure with a fixed size containing elements (items) of the same type. Iterate over an array using for loop
or for range loop
.
For loop examples in Golang
How to write a for
loop using Golang programming language. Similar with other programing languages, the basic for
loop has three components separated by semicolons.
Interfaces in Golang
Interfaces are collections of method signatures. A interface type can hold any value that implements those methods. The empty interface is an interface type that specifies zero methods. A type assertion provides access to an interface underlying concrete value. Two interfaces are equal if they have equal concrete values and identical dynamic types, or if both are nil.
How to show open database connections in MySQL
How to show open database connections in MySQL using show status
and show processlist
command.
How to read CSV file in Golang
How to read CSV file in Golang using reader from encoding/csv
package. For this example we took an simple example of a CSV file containing three columns name, address and phone.