Просмотр исходного кода

Small improvements for config parsing

tags/v2.0.0-rc1
9seconds 5 лет назад
Родитель
Сommit
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 {

Загрузка…
Отмена
Сохранить