Example #1
0
func loadCredentials(t *testing.T) (*App, *Token) {
	file := "credentials.conf"
	cfg := &testConfig{}
	if err := config.ParseFile(file, cfg); err != nil {
		t.Skipf("error parsing credentials: %s", err)
	}
	return cfg.TwitterApp, cfg.TwitterToken
}
Example #2
0
func (g *Governator) parseConfig(filename string) *Config {
	cfg := &Config{File: filename}
	err := config.ParseFile(g.servicePath(filename), cfg)
	cfg.Err = err
	if cfg.Log == nil {
		cfg.Log = new(Logger)
		cfg.Log.Parse("")
	}
	cfg.Name = cfg.ServiceName()
	cfg.Log.Name = cfg.Name
	return cfg
}