mirror of
https://gitee.com/johng/gf
synced 2026-06-30 11:05:11 +08:00
cee6f499fc71cb7e4266e14547f1102ef14fcc79
## Summary - Fix `gf gen enums` output file created at wrong location when using relative path - Output was incorrectly relative to source directory instead of current working directory - Add `defer gfile.Chdir(originPwd)` to restore original working directory ## Root Cause The code calls `gfile.Chdir(realPath)` to change to source directory before `gfile.PutContents(in.Path, ...)`, causing relative output path to be resolved relative to source directory. ## Solution - Convert output path to absolute using `gfile.Abs()` before `Chdir` - Restore original working directory with `defer` (following `genpb.go` pattern) ## Test Cases - `Test_Gen_Enums_Issue4387_RelativePath` - standard project with relative path - `Test_Gen_Enums_AbsolutePath` - absolute path (should work as before) - `Test_Gen_Enums_Issue4387_Monorepo` - monorepo mode (`cd app/xxx && gf gen enums`) Closes #4387
refract(gerror): add ITextArgs interface and its implements, mainly for i18n that needs text and args separately (#4597)
fix(util/gconv): fix incompatable converting to nil pointer target from older version implement (#4224)
fix(contrib/drivers): resolve field duplication issue when same table/column names exist across different MySQL/MariaDB databases (#4577)
English | 简体中文
A powerful framework for faster, easier, and more efficient project development.
Installation
go get -u github.com/gogf/gf/v2
Documentation
- Official Site: https://goframe.org
- Official Site(en): https://goframe.org/en
- 国内镜像: https://goframe.org.cn
- Mirror Site: Github Pages
- Mirror Site: Offline Docs
- GoDoc API: https://pkg.go.dev/github.com/gogf/gf/v2
- Doc Source: https://github.com/gogf/gf-site
Contributors
💖 Thanks to all the contributors who made GoFrame possible 💖
License
GoFrame is licensed under the MIT License, 100% free and open-source, forever.
Languages
GO
100%
