From d6582fab6f2a9ceb58b4a991665e5b3a44469568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ib=C3=A1=C3=B1ez?= Date: Fri, 30 Apr 2021 20:47:14 +0200 Subject: [PATCH] [cfg] Make parseBaseConfig() independent of cmd/gost/main.go --- cmd/gost/cfg.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/gost/cfg.go b/cmd/gost/cfg.go index b8fda231..05071997 100644 --- a/cmd/gost/cfg.go +++ b/cmd/gost/cfg.go @@ -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 (