浏览代码

Small improvements for config parsing

tags/v2.0.0-rc1
9seconds 5 年前
父节点
当前提交
c04f9e392a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      config/config.go

+ 2
- 2
config/config.go 查看文件

148
 	}
148
 	}
149
 
149
 
150
 	if err := jsonEncoder.Encode(rawConf); err != nil {
150
 	if err := jsonEncoder.Encode(rawConf); err != nil {
151
-		return nil, fmt.Errorf("cannot dump into interim format: %w", err)
151
+		panic(err)
152
 	}
152
 	}
153
 
153
 
154
 	if err := json.NewDecoder(jsonBuf).Decode(conf); err != nil {
154
 	if err := json.NewDecoder(jsonBuf).Decode(conf); err != nil {
155
-		return nil, fmt.Errorf("cannot parse final config: %w", err)
155
+        return nil, fmt.Errorf("cannot parse a config: %w", err)
156
 	}
156
 	}
157
 
157
 
158
 	if err := conf.Validate(); err != nil {
158
 	if err := conf.Validate(); err != nil {

正在加载...
取消
保存