conf.go 454 B

123456789101112131415161718192021222324
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package utils
  5. import (
  6. "fmt"
  7. "os"
  8. "github.com/Unknwon/goconfig"
  9. )
  10. var Cfg *goconfig.ConfigFile
  11. func init() {
  12. var err error
  13. Cfg, err = goconfig.LoadConfigFile("conf/app.ini")
  14. if err != nil {
  15. fmt.Println("Cannot load config file 'app.ini'")
  16. os.Exit(2)
  17. }
  18. Cfg.BlockMode = false
  19. }