core: Config path is a file, not a directory

This commit is contained in:
John Brooks 2016-11-05 16:48:54 -06:00
parent f0c4c5afcd
commit 569a138e21
1 changed files with 2 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import (
"io/ioutil"
"log"
"os"
"path/filepath"
"sync"
)
@ -14,7 +13,6 @@ import (
// an automatic import function.
type Config struct {
path string
filePath string
root ConfigRoot
@ -52,10 +50,9 @@ type ConfigIdentity struct {
ServiceKey string
}
func LoadConfig(configPath string) (*Config, error) {
func LoadConfig(filePath string) (*Config, error) {
config := &Config{
path: configPath,
filePath: filepath.Join(configPath, "ricochet.json"),
filePath: filePath,
}
data, err := ioutil.ReadFile(config.filePath)
@ -69,7 +66,6 @@ func LoadConfig(configPath string) (*Config, error) {
return nil, err
}
log.Printf("Config: %v", config.root)
return config, nil
}