Fix config parsing
This commit is contained in:
parent
eb4fa0b799
commit
72b511a120
|
@ -29,12 +29,14 @@ type ServerConfig struct {
|
|||
ListenAddress string `json:"listen_address"`
|
||||
}
|
||||
|
||||
func ParseFromFile(path string) (config *Config, err error) {
|
||||
func ParseFromFile(path string) (*Config, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
config := &Config{}
|
||||
|
||||
err = json.Unmarshal(data, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue