MarcSky / environ

Little library for converting environment variable to certain type

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

environ

Library for converting environment variable to certain type

Smooth conversation

Smooth conversation (with default value if env not exist) string to

  • int
  • int64
  • uint64
  • string (with default value)
  • float64

Example ServerPort := environ.StrGetEnv("SERVER_PORT", 80)

Strict conversation

Strict conversation (with panic if var not exist) string to

  • int
  • int64
  • uint64
  • string
  • float64

Example ServerPort := environ.MustGetString("SERVER_PORT")

About

Little library for converting environment variable to certain type

License:GNU General Public License v3.0


Languages

Language:Go 100.0%