Skip to content

Commit

Permalink
[cfg] Make parseBaseConfig() independent of cmd/gost/main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Ibáñez committed Apr 30, 2021
1 parent a4695ec commit d6582fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/gost/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ type baseConfig struct {
Debug bool
}

func parseBaseConfig(s string) (*baseConfig, error) {
func parseBaseConfig(s string, baseCfg *baseConfig) error {
file, err := os.Open(s)
if err != nil {
return nil, err
return err
}
defer file.Close()

if err := json.NewDecoder(file).Decode(baseCfg); err != nil {
return nil, err
return err
}

return baseCfg, nil
return nil
}

var (
Expand Down

0 comments on commit d6582fa

Please # to comment.