code: func LoadConfig(path string) (*Config, error) {
  	settings := &Config{}
  
  	c, err := config.ReadDefault(path)
  	if err != nil {
  		return nil, err
  	}
  
  	// Cloudinary settings
  	var cURI *url.URL
  	var uri string
  
  	if uri, err = c.String("cloudinary", "uri"); err != nil {
  		return nil, err
  	}
  	if cURI, err = url.Parse(uri); err != nil {
  		return nil, errors.New(fmt.Sprint("cloudinary URI: ", err.Error()))
  	}
  	settings.CloudinaryURI = cURI
  
  	// An optional remote prepend path
  	if prepend, err := c.String("cloudinary", "prepend"); err == nil {
  		settings.PrependPath = cloudinary.EnsureTrailingSlash(prepend)
  	}
  	settings.ProdTag, _ = c.String("global", "prodtag")
  
  	// Keep files regexp? (optional)
  	var pattern string
  	pattern, _ = c.String("cloudinary", "keepfiles")
  	if pattern != "" {
  		settings.KeepFilesPattern = pattern
  	}
  
  	// mongodb section (optional)
  	uri, _ = c.String("database", "uri")
  	if uri != "" {
  		var mURI *url.URL
  		if mURI, err = url.Parse(uri); err != nil {
  			return nil, errors.New(fmt.Sprint("mongoDB URI: ", err.Error()))
  		}
  		settings.MongoURI = mURI
  	} else {
  		fmt.Fprintf(os.Stderr, "Warning: database not set (upload sync disabled)\n")
  	}
  
  	// Looks for env variables, perform substitutions if needed
  	if err := settings.handleEnvVars(); err != nil {
  		return nil, err
  	}
  	return settings, nil
  }
docs: // LoadConfig parses a config file and sets global settings
  // variables to be used at runtime. Note that returning an error
  // will cause the application to exit with code error 1.