Go Community Linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Go community here or just enjoy what everyone else has found!


Go config management. support JSON, YAML, TOML, INI, HCL, ENV and Flags

gookit/config - Go config management. support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var.

Features

  • Support multi format: JSON(default), INI, YAML, TOML, HCL
    • JSON content support comments. will auto clear comments
  • Support multi-file and multi-data loading
  • Support loading configuration from os ENV
  • Support for loading configuration data from remote URLs
  • Support for setting configuration data from command line arguments(flags)
  • Support data overlay and merge, automatically load by key when loading multiple copies of data
  • Support get sub value by path, like map.key arr.2
  • Support parse ENV name. like envKey: ${SHELL} -> envKey: /bin/zsh
  • Generic api Get Int Uint Int64 Float String Bool Ints IntMap Strings StringMap ...
  • Complete unit test(code coverage > 95%)

Provide a sub-package dotenv that supports importing data from files (eg .env) to ENV

Github Repo

Posted by:  Inhere