1234567891011121314151617181920212223 |
- package main
- import (
- "git.ali33.ru/fcg-xvii/go-tools/text/config"
- _ "git.ali33.ru/fcg-xvii/go-tools/text/config/ini"
- "github.com/sirupsen/logrus"
- )
- var (
- logger = logrus.New()
- )
- func main() {
- // parse config
- conf, err := config.FromFile("ini", "config.ini")
- if err != nil {
- logger.WithFields(logrus.Fields{
- "file": "config.ini",
- }).Panicf("CONFIG FILE IS NOT FOUND (%v)", err)
- }
- one := conf.ValueDefault("one", []string{})
- logger.Info(one)
- }
|