internal/config: загрузка YAML+env (подстановка ${VAR:-default}, defaults, env override, Validate)
All checks were successful
build-test / build (push) Successful in 1m23s
All checks were successful
build-test / build (push) Successful in 1m23s
This commit is contained in:
15
internal/config/errors.go
Normal file
15
internal/config/errors.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package config
|
||||
|
||||
import "errors"
|
||||
|
||||
// Классы ошибок конфига (C1..C4).
|
||||
var (
|
||||
// C1 — обязательное поле пусто (токен, url и т.п.)
|
||||
ErrMissingField = errors.New("config: missing required field")
|
||||
|
||||
// C2 — невалидный формат (YAML-синтаксис, Duration, число)
|
||||
ErrInvalidFormat = errors.New("config: invalid format")
|
||||
|
||||
// C4 — файл конфига не найден (не fatal: Load ищет ./config.yaml, флаг --config)
|
||||
ErrFileNotFound = errors.New("config: file not found")
|
||||
)
|
||||
Reference in New Issue
Block a user