Articles in this series
Slice Empty a slice a := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} a = a[:0] // or a = nil Prepend b := []int{2, 3, 4} b = append([]int{1},...
Env Functions to operate environment variables: os.Getenv: get env variable by name, if not set, return empty string os.LookupEnv: return (value,...
Flag package main import ( "flag" "fmt" ) func main() { count := flag.Int("count", 0, "run time count") prefix :=...
String to Number Atoi k, _ := strconv.Atoi("135") // k = 135 n, e := strconv.Atoi("wat") // n = 0, e is not nil ParseInt i, _ :=...
Get User Input from Stdin Scanln & Scanf var name string fmt.Scanln(&name) // this will scan only one string token (if there is a space in your...
base64,32,58 encoding base64 Standard Encoding/Decoding import ( "encoding/base64" "fmt" ) func main() { data := []byte("test data") ...