Skip to content

Commit

Permalink
config.LoadConfig is redundant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Buhrietoe committed Jan 9, 2017
1 parent 82d4fa6 commit 6215ac5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
// Load config
configFile := args["--config"].(string)

config := config.LoadConfig(configFile)
config := config.Load(configFile)

// Build and run web server
serv := server.BuildServer()
Expand Down
4 changes: 2 additions & 2 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type BroodConfig struct {
Auth auth.Auth // Auth config
}

// LoadConfig retrieves data needed to start the server
func LoadConfig(configFile string) (config BroodConfig) {
// Load retrieves data needed to start the server
func Load(configFile string) (config BroodConfig) {
viper.SetEnvPrefix("brood")
viper.SetConfigType("toml")
viper.SetConfigName("brood")
Expand Down
4 changes: 2 additions & 2 deletions server/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"testing"
)

func TestLoadConfig(t *testing.T) {
func TestLoad(t *testing.T) {
os.Setenv("BROOD_SERVER_ADDRESS", "127.0.0.1")
os.Setenv("BROOD_SERVER_PORT", "1111")

testConfig := LoadConfig("")
testConfig := Load("")

if testConfig.Server.ListenString != "127.0.0.1:1111" {
t.Errorf("Server ListenString expected '127.0.0.1:1111', got %v\n", testConfig.Server.ListenString)
Expand Down

0 comments on commit 6215ac5

Please sign in to comment.