Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 501 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 501 Bytes

Go tutorial.

  1. Deal with JSON file
  • parse
json.Unmarshal
  • stringify(js)
json.Marshal
  1. Deal with environment variables
    // load some ENV files first (".dev.env", prod.env)
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error, loading env fail")
	}
	// Load successfull then get Key
	key := os.Getenv("SUPER_KEY")
	log.Println("KEY", key)
  1. Composition vs inheritace