Files
gf/.gitignore
Jack Ling 095c69c424 fix(cmd/gf): fix gf env and gf build --dumpEnv command error (#4635)
## 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
2026-01-21 19:15:57 +08:00

28 lines
280 B
Plaintext

.buildpath
.hgignore.swp
.project
.orig
.swp
.idea/
.settings/
.vscode/
vendor/
bin/
**/.DS_Store
.test/
cmd/gf/main
cmd/gf/gf
temp/
example/log
go.work
go.work.sum
!cmd/gf/go.work
.windsurfrules
# Ignore for docs
node_modules
.docusaurus
output
.example/
.golangci.bck.yml
*.exe