9951 explained code solutions for 126 technologies


golangHow to get environment variable


package main
import "os"

func main() {
  print( os.Getenv("PWD") )
}ctrl + c
import "os"

import os module to work with environment variables

os.Getenv(

returns value for a given environment variable

PWD

name of environment variable to get value of