Hello, everyone! You've been waiting! It's been just six months since the last release, and many things have happened in this half-year. Schrödinger's cat determines different outcomes for the kitten by different means of observation, and similarly, the way we view the world shapes how the world appears to us. This time we bring you the latest GoFrame v1.16 version! GoFrame is a modular, high-performance, enterprise-grade Go foundational development framework: https://goframe.org, a low-key, pragmatic enterprise-grade Golang development framework in the true sense! This update includes numerous new features and enhancements, especially full tracing, ORM model association/nested transactions/subqueries/dozens of new methods, HTTP client interceptor, data validation and I18N enhancements, refactored timer, and more. There are a lot of updates this time, below are the major updates, hope you like them! Enjoy!

This documentation has been extensively updated, with the total development documentation now containing over 200,000 words. It is recommended to read according to the official directory structure.
Important Features
- The framework introduces full tracing, adopting the
OpenTelemetrystandard, currently integratingHTTP Client&Server/GRPC Client&Server/ORM/Redis/Loggingcomponents. For detailed introduction, please refer to the sections: - The core database components have added the following features:
- Model Association:
- Nested Transactions: ORM - Transaction
- Subquery feature: Model Query - Subquery
- Added dozens of ORM model operation methods (referencing
PHP Laravel), it is highly recommended for those usinggoframeto take a look:
- HTTP client adds middleware interceptor functionality, for details, please refer to the section: HTTPClient - Middleware
- Extensive improvements to the data validation component:
- Added chain operation verification objects: Data Validation - Object
- Added support for
Context, and enhanced support for powerfulI18Ninternational error information management. For details, please refer to the sections: - Custom validation rules have been improved, with added features for local validation rule registration and full data validation: Data Validation - Custom
- The timer component
gtimeris fully restructured, removing theTimingWheelimplementation and adopting a more robustPriorityQueueimproved implementation. For details, refer to the section: Timer - The framework's core foundational components have added a full error stack feature, allowing complete retrieval of error stack information for related components in the event of an error. This feature is only available in a well-designed, comprehensive foundational component framework.
Functionality Improvements
ORM- Added full tracing context
Contextparameter passing: ORM - Context During tracing, it will recordSQLand database connection information (excluding sensitive configurations), and the component tracing information can be configured to be turned off. - Further improved the
ORMcomponent logging, which is only valid in debug mode. For detailed introduction, refer to the section: ORM - Senior Features - Added dozens of
ORMmodel operation methods referencingPHP Laravel, such asInsertAndGetId,Min/Max/Avg/Sum,Increment/Decrement,WhereBetween/WhereLike/WhereIn/WhereNull,OrderAsc/OrderDesc/OrderRandom, etc. It is highly recommended for those usinggoframeto take a look, for details, refer to the section: - In the new version, the database
ORMchain operation has enabled field filtering by default. Parameters that cannot be intelligently matched with table fields will be automatically filtered. For details, refer to the section: ORM Model - Fields Filtering - Improved the conversion of
pgsqldatabase typeint8toGolangtype, frominttype adjusted toint64. - Extensive refactoring and improvement work have been done, too detailed to describe each. The key result is richer component functionality, more rigorous code, simpler design, and easier use.
- Added full tracing context
HTTPHTTP Clientadds middleware interceptor functionality: HTTPClient - MiddlewareHTTP Client&Serveradds tracing support: Tracing - HTTP Example- The client request method in the
ghttppackage is marked deprecated, and will be unified to use theHTTP Clientobject in the future. - Improved the data validation of
Request.Parsemethod, directly validating submitted parameters instead of thestructobject converted from data: Request - Validation - Added
WrapF/WrapHmethods to convert standard libraryhttp.HandlerFunc/http.Handlerto service method types supported byghttp.Server. - Numerous other improvements, with many details. The key outcome is richer component functionality, more rigorous code, and easier use.
gvalid- The
Checkmethod name is changed toCheckValue, for details, refer to the section: Data Type - Value - Added
CheckStructWithDatamethod to validate thestructobject of specified parameters: Struct Validation - Example - Added
Validatorvalidation object for convenient chain operation, allowing further expansion later: Data Validation - Object - Custom rule method definitions now include
Contextvariables and addedRuleFuncandRuleFuncMaplocal validation rule registration methods: Data Validation - Custom - Validation methods have added
Contextparameter support, and improved to support powerfulI18Ninternational error information management capabilities: Errorobject is modified to interface implementation, note that previous usage with*Errorpointer will result in errors.- Some other detail improvements.
- The
gcache- Added
Ctxchain operation method for context parameter input, for details, refer to the section: Caching - The
Adapterinterface addsContextparameter input, facilitating context parameter passing, and improved adapters in built-in implementation supporting context parameter passing: Caching - Interface
- Added
gredis- Added support for tracing, for details, refer to the section: Redis-Context
gjson- The
Optiontype name was changed toOptions, this is a breaking change. - The
NewWithOptionmethod name was changed toNewWithOptions.
- The
gcmd- Added
GetOptWithEnvmethod and markedGetWithEnvmethod as deprecated.
- Added
glog- Added tracing support based on the
OpenTelemetrystandard: Logging - Context
- Added tracing support based on the
gproc- Added unified signal registration listening callback feature: Process - Signal
gres- Best practices for resource management can be found here: Resource - Best Practices
gtimer- Timer component
gtimeris fully restructured, removing theTimingWheelimplementation, and adopting a more robustPriorityQueueimproved implementation. Details can be found here: Timer gview- All template parsing methods added a
Contextparameter input: Template Engine gconv- Improved
Scanmethod by adding automatic conversion support forMap/Mapsparameter types: Type Conversion - Scan gi18n- The
I18Ninternationalization component adds support forContext, for details, refer to the section: I18N - Note that all methods now have a
ctxparameter input, and some methods have removed thelanguageparameter, instead controlled byctxto inputlanguage, enhancing extensibility: I18N - Example - Removed
TranslateFormatLangandTflmethods. gmeta- Newly added
gmetametadata package, for details, refer to the section: Metadata - Other detailed improvements in various components, not necessary to specifically detail in the release documentation.
Development Toolchain
CLI tools have been updated, mainly simplifying dao model code generation, eliminating redundant method generation, and removing methods that directly return model objects. The dao object is modified to directly inherit the GoFrame ORM component's Model object, accepting query data through the specified model, hence the ways of using some methods may require adjustments.