How to measure execution time in Golang
To mesure the time used by an application in Golang or of a code section the functions time.Now()
and time.Since()
can be used.
How to fix mspdb100.dll is missing from your computer
How to fix The program can't start because mspdb100.dll is missing from your computer. Try reinstalling the program to fix this problem.
by adding the VC 10.0 IDE on the Windows system environment variables or by running the vcvars32.bat
for the current session.
How to generate a random int in Golang
In Golang there a are two libraries for generating random integers, one is a pseudo-random number generator (package math/rand
) and the second one is cryptographically secure random number generator (package crypto/rand
)
How to trim whitespace from string in Golang
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
How to fix the E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
error.
How to get the dimensions of an image in Golang
Here are two simple methods to get the dimensions of an image in Golang: using image.DecodeConfig
method if the image is not already loaded and image.Decode
method is the image is loaded.