We are pleased to announce the official release of GoFrame version v2.8.0! This update brings significant improvements and new features, enhancing GoFrame in terms of development efficiency, execution performance, stability, and extensibility.
Version Highlights
-
Compatibility Update
GoFrame v2.8.0requires a minimumGolangversion of1.20to provide more efficient performance and stability.- The
container/gringcomponent has been deprecated, and thecontrib/trace/jaegercomponent has been removed from the source code repository, simplifying dependency management.
-
Component Improvements
- The
database/gdbmodule now supportscreated_at/updated_at/deleted_atinteger timestamp fields,unix socketconnections,time/yearfield types, and introduces theModel.Existmethod, significantly improving the flexibility and efficiency of database operations. - The
util/gconvcomponent leverages type caching to enhance conversion performance, with conversion performance for complex data types improved by approximately300%. - The
net/ghttpandnet/gudpnetwork service components have optimized parameter configurations and request processing logic, providing a more streamlined development experience.
- The
-
Development Tools Upgrade
- The
gf initcommand supports generating a multi-application project structure within a single repository. - Optimizations to commands like
gf gen ctrl,gf gen dao, andgf run, further enhance code generation flexibility and execution efficiency, simplifying project setup processes.
- The
-
Community Component Support
- Added support for the latest features in multiple community drivers such as
contrib/drivers/mssqlandcontrib/registry/etcd, improving integration with external services.
- Added support for the latest features in multiple community drivers such as
Future Outlook
The GoFrame team thanks all community users for their support. We will continue to listen to community feedback to provide users with richer features and more efficient development support.
Special Thanks
💖💖💖 Thanks to all the contributing developers for this release 💖💖💖

Main Content
This release contains numerous changes. Below are the major updates in this version; for a detailed Change Log, please refer to:
https://github.com/gogf/gf/releases/tag/v2.8.0
For comprehensive code changes, please refer to: https://github.com/gogf/gf/compare/v2.7.0...v2.8.0
Compatibility Notice
- The minimum
Golangversion requirement has been adjusted from1.18to1.20. - The
container/gringcomponent is marked as deprecated and will no longer be maintained. - The
contrib/trace/jaegercomponent has been removed from the source code repository. - The parameter of
Load*methods in theencoding/gjsoncomponent has been adjusted frominterface{}to[]byteto improve performance. - The port parameter of the
StartPProfServermethod in thenet/ghttpcomponent has been changed fromport inttoaddress stringfor increased flexibility. - The
net/gudpcomponent has been refactored, with individual method parameter adjustments: UDP
Component Improvements
-
database/gdb- Time maintenance features have been enhanced to support integer fields. When
created_at/updated_at/deleted_atare integer fields, they will be updated with timestamps. For details, see: ORM Model - Time Fields - Added the
Model.Existmethod to determine if data that meets given conditions exists: Model Query - Exist - Added support for
time/yearfield types in the database: ORM Senior - Type Recognition - Added the
OrderRandomFunctioninterface method, implemented and supported theOrderRandomsorting method for common databases. - Improved the
Model.Fieldsmethod to supportgdb.Rawtype parameters: ORM Model - Fields Retrieval - Enhanced the
Withfeature inormtags to supportunscoped: Model Association - With - Added support for
unix socketlocal database service connections in the configuration file. - Removed
sqlstatements from trace information to reduce the size of thetracepackage. - Improved performance of query result conversion to
struct.
- Time maintenance features have been enhanced to support integer fields. When
-
net/ghttp- Removed
XxxReq/XxxResnaming restrictions for input and output objects in route registrations. - Adjusted the port parameter of
StartPProfServerfromport inttoaddress stringfor increased flexibility. - Removed request/response data from trace information to reduce the size of the
tracepackage. - Fixed graceful shutdown issues with the
/debug/admin/shutdowninterface.
- Removed
-
net/goai- Allowed specifying parameter types in request/response structure attributes using the
typetag.
- Allowed specifying parameter types in request/response structure attributes using the
-
container/gtree- Refactored
gtreeimplementation using the third-party data structure componentgithub.com/emirpasic/godsto enhance extensibility and maintainability.
- Refactored
-
encoding/gjson- Adjusted
Load*method parameters frominterface{}to[]byteto improve performance.
- Adjusted
-
os/gcron- Added
StopGracefullymethod to allow waiting for currently executing scheduled tasks to complete before stopping: Cron Job - Usage
- Added
-
os/gfsnotify- Improved file recursive monitoring implementation so that when a directory is being monitored, newly created subdirectories within it, or their subdirectories, will also be recursively monitored: File Watching
-
test/gtest- Improved
AssertIN/AssertNIassertion methods by adding support for substring containment assertions.
- Improved
-
util/gvalid- Added
required-if-allvalidation rule, where a parameter is mandatory if all specified parameters and their values are equal: Data Validation - Rules - Enhanced
phonevalidation rule by adding support for171series phone numbers.
- Added
-
util/gconv- Enhanced conversion performance with type caching, improving conversion performance for complex data types by approximately
300%.
- Enhanced conversion performance with type caching, improving conversion performance for complex data types by approximately
Community Components
-
drivers/mssql- Changed the base
driverfromgithub.com/denisenkom/go-mssqldbto the official componentgithub.com/microsoft/go-mssqldb.
- Changed the base
-
contrib/drivers/pgsql- Added support for
InsertIgnoreoperations. - Added support for operations from
Golangarray types to database array field types.
- Added support for
-
contrib/registry/etcd- Added
DialTimeoutandAutoSyncIntervalconfiguration options.
- Added
-
contrib/registry/nacos- Replaced the dependency on
github.com/joy999/nacos-sdk-gowith the official componentgithub.com/nacos-group/nacos-sdk-go/v2.
- Replaced the dependency on
-
contrib/rpc/grpcx- Removed request/response data from trace information to reduce the size of the
tracepackage. - Since the
grpccomponent has enabled thegrpc.Dialmethod,grpc.NewClientis now used to replacegrpc.Dial.
- Removed request/response data from trace information to reduce the size of the
-
contrib/sdk/httpclient- Added
Handlerinterface to allow users to customize the handling ofHTTP Clientreturn data.
- Added
Development Tools
-
Improved the
gf initcommand by adding the-a/monoAppoption for creating new application project templates in a large repository: Project Scaffold -
Enhanced the
gf packcommand by adding support for command parameter options from a configuration file, with the configuration path asgfcli.pack. -
Enhanced the
gf tplcommand by adding support for command parameter options from a configuration file, with the configuration path asgfcli.tpl.parse. -
Improved the
gf gen ctrlcommand by re-implementing parsing logic usingAST, increasing the accuracy of generatedGocode file content, and enhancing the extensibility of the feature. -
Improved the
gf runcommand:- Added support for command parameter options from a configuration file, with the configuration path as
gfcli.run. - Automatically deletes temporary old process binary files when a new process replaces the old one at the end of a temporary subprocess.
- Added support for command parameter options from a configuration file, with the configuration path as
-
Improved the
gf gen daocommand:- Added
field mappingfeature to support specifying field configurations for generatedGolangdata types: Dao/Do/Entity Generating - Automatically identifies integer fields with a length of
1, such asbit(1)/tinyint(1)/int(1), asbooltypeGolangdata types. - Automatically reads the directory name of generated code files as the package name for generating
dao/do/entityfiles. - Due to database restrictions, the
clihas removed default support for thedmdatabase. If needed, please manually modify the source code to installcli. - Fixed the issue where the
linkparameter becomes invalid when both thelinkparameter and configuration file exist simultaneously.
- Added