mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
## Summary - Fix `gf env` and `gf build --dumpEnv` command failing when `go env` outputs warning messages - When `go env` outputs warnings (e.g., invalid characters in environment variables), it returns non-zero exit code but still provides valid output - The original code would fail in this case ## Changes - Only fail when `go env` returns empty output, allow non-zero exit code with valid output - Skip lines that don't match `key=value` format instead of failing with Fatal error - Add debug log for skipped lines to help troubleshooting - Add unit tests for env command ## Related Issue Fixes #4469 ## Test plan - [x] `gf env` command works correctly even when `go env` outputs warnings - [x] `gf build --dumpEnv` works correctly - [x] Added unit tests pass