main.go 463 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "git.ali33.ru/fcg-xvii/go-tools/text/config"
  4. _ "git.ali33.ru/fcg-xvii/go-tools/text/config/ini"
  5. "github.com/sirupsen/logrus"
  6. )
  7. var (
  8. logger = logrus.New()
  9. )
  10. func main() {
  11. // parse config
  12. conf, err := config.FromFile("ini", "config.ini")
  13. if err != nil {
  14. logger.WithFields(logrus.Fields{
  15. "file": "config.ini",
  16. }).Panicf("CONFIG FILE IS NOT FOUND (%v)", err)
  17. }
  18. one := conf.ValueDefault("one", []string{})
  19. logger.Info(one)
  20. }