How to disable submit button with jQuery
For a long submit operation or to avoid users clicking twice a submit button, a common solution is to disable the submit button after user clicked on it.
To disable a button using jQuery you need to add the disabled
attribute to the button as true.
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.
How to write CSV file in Golang
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 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 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.