feat(config): warn on invalid environment variable values #123

Closed
opened 2026-07-13 17:21:27 +00:00 by the.auditor · 1 comment
Owner

internal/config/config.go:51-72applyEnvOverrides silently ignores invalid env var values.

If user sets PGET_CONCURRENCY=abc or PGET_TIMEOUT=not-a-duration, the invalid value is silently dropped and the flag default (or CLI flag value) is used instead.

Suggestion: log a warning to stderr when env var parsing fails, e.g.:

warning: invalid PGET_CONCURRENCY value "abc", ignoring

Discovered during review of PR #122.

`internal/config/config.go:51-72` — `applyEnvOverrides` silently ignores invalid env var values. If user sets `PGET_CONCURRENCY=abc` or `PGET_TIMEOUT=not-a-duration`, the invalid value is silently dropped and the flag default (or CLI flag value) is used instead. Suggestion: log a warning to stderr when env var parsing fails, e.g.: ``` warning: invalid PGET_CONCURRENCY value "abc", ignoring ``` Discovered during review of PR #122.
Owner

Closing — implemented in PR #168. Invalid env var values now print a warning to stderr: "warning: invalid PGET_CONCURRENCY value "abc", ignoring"

Closing — implemented in PR #[168](https://git.lan.thwap.org/thwap/pget/pulls/168). Invalid env var values now print a warning to stderr: "warning: invalid PGET_CONCURRENCY value "abc", ignoring"
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget#123
No description provided.