Skip to content

Go tutorials for absolute begginers. Complete with code examples and comments explaining them.

License

Notifications You must be signed in to change notification settings

sxmbaka/go-plgrd

Repository files navigation


  1. Hello World in Go
  2. Semicolons in Go
  3. Short Declarations
    (Using the := operator)
  4. iota in Go
  5. Enumerations in Go
What are Go Runtime Environment Variables?

The go env command prints the value of environment variables used by the Go tools. These variables are used to configure the behavior of the Go tools and the Go runtime. These runtime environment variables are used to control the behavior of the Go runtime, and the Go tools. The Go tools include the go command, the gofmt command, and the godoc command. The Go runtime is the part of the Go toolchain that executes Go programs.

Manipulating Go runtime environment variables:

  • Show all environment variables
    go env
  • Show a specific environment variable
    go env [GOPATH]
  • Set an environment variable to a value
    go env -w [GOBIN]=[path/to/directory]
  • Reset an environment variable's value
    go env -u [GOBIN]
  • Get help on a specific subcommand
    # tells you about the -w flag
    go help env -w
  • Get more help
    # tells you about the go env command
    go help env
    # tells you about all the Go environment variables
    go help environment

Read further at:

The following environment variables ($name or %name%, depending on the host operating system) control the run-time behavior of Go programs. The meanings and use may change from release to release.

This arrangement lists the Go runtime environment variables in alphabetical order for easier reference and lookup.

  1. GOCACHE and GOTMPDIR
  2. GOGC
  3. GO111MODULE
  4. GOARCH and GOOS
  5. GOBIN
  6. GOENV
  7. GOFLAGS
  8. GOMAXPROCS
  9. GOMOD
  10. GOPATH
  11. GOPROXY
  12. GOROOT
  13. GOTRACEBACK
  14. GODEBUG
  1. Variable Types
  2. Operations on variables
    (You might need to study Operators in case of any anomalies)
  3. Type Conversions
  4. Type Inference
  5. Type Inference
    (Read further at https://go.dev/blog/type-inference)
  6. Variable Naming Conventions
  7. Variable Scopes
  8. Variable Shadowing
  9. Constants in Go
    (Read further at https://golangbyexample.com/constant-golang/)
  10. Abbreviated Variable Declarations

Tip: Create a playground directory in the root directory and then test these examples yourself.

About

Go tutorials for absolute begginers. Complete with code examples and comments explaining them.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages