HOWTO do things in Go

package main

import (
  t "time"
)

func main() {
  t.Now()
}

func main() {
  users := []string{"Juanito", "Keith"}

  // for index, value := range array
  for _, user := range names {
    fmt.Println("User: ", user)
  }
}

import (
  "os"
)

func main() {
  os.Exit(1)
}

import (
  "os"
)

func main() {
  os.Getenv("GITHUB_API_TOKEN")
}

import (
  "fmt"
)

func main() {
  fmt.Fprintf(l.stdout(), "[DEBUG] " + out)
  fmt.Fprintf(l.stderr(), "[ERROR] " + err)
}

import (
  "fmt"
  "os"
)

func main() {
  return fmt.Errorf("error: %w", err)
}

// Print to Standard Error
err := f.thisMayError()

if err != nil {
  fmt.Fprintf(os.Stderr, "error: %v\n", err)
}

import (
  "strconv"
)

func main() {
  var n int = 0
  str := strconv.Itoa(n)

  fmt.Printf("n -> String: %s", str)
}

https://golang.org/src/time/time.go

import (
  "time"
)

// Get time now
func main() {
  time.Now()
  time.Sleep(time.Second) // sleep 1s
}