Hello everyone! From late autumn to deep winter, we haven't been idle since the last release. We've brought you a heartwarming GoFrame v1.15 version this time. In addition, there are two other things:
GoFramewas selected byOSCOpen Source China as one of theTOP30open source projects of2020: https://www.oschina.net/question/2918182_2320114. Thank you for your recognition and support! Meanwhile,GoFrameis also aGitee GVPMost Valuable Project.- The official website of
GoFramehas been redesigned. You only need to experience it for a few minutes, and you'll be like me, loving this framework: https://goframe.org. Thanks to Atlassian for the sponsorship, providing full product line license codes!
After years of dedicated development and stable growth, GoFrame has gradually grown into an enterprise-level Golang basic development framework, offering project development standards, development toolchains, complete basic modules, rich development documentation, high code quality, and an active community. To ensure the quality of the framework, we've conducted extensive unit testing across components to ensure logical correctness (2534 test units, 9097 test assertions), while maintaining high-quality documentation. To date, many large, medium, and small internet companies have used GoFrame in production environments.
Open source is not easy, and with your understanding and support, happiness is abundant! Thank you to all the partners involved in the project development, love you all! GoFrame, YES!
GoFrame
GF(Go Frame) is a modular, high-performance, enterprise-level Go basic development framework. It provides a complete infrastructure and development toolchain, offering commonly used basic development modules such as caching, logging, queues, arrays, sets, containers, timers, command lines, memory locks, configuration management, resource management, data validation, scheduled tasks, database ORM, TCP/UDP components, process management/communication, etc. It also provides a series of core components for Web service development, such as Router, Cookie, Session, Middleware, service registration, template engine, and supports hot restart, hot update, domain binding, TLS/HTTPS, Rewrite, and other features.
If you are new to the
Golanguage, you can compareGoFrametoLaravelinPHP,SpringBootinJava, orDjangoinPython.

Features
- Modular, loosely coupled design;
- Rich modules, ready to use;
- Simple and easy to use, easy to maintain;
- High code quality, high unit test coverage;
- Active community, humble and low-key experts;
- Detailed development documentation and examples;
- Comprehensive local Chinese support;
- Designed for team and enterprise use;
Change Logs
-
ghttp- Improved
HTTPClientGETrequest methods, automatically constructing parameters asQueryStringinstead ofBodyto ensure compatibility with other servers. - Added default value setting feature to
Requestobjects: Request - Default Value - Added
Request.SetCtxmethod for custom context variables, commonly used in middleware/interceptors: Request - Context - Added
Requestvariable in template parsing to get client request parameters regardless ofQueryString/Formtype: Response - Template Parsing - Improved
Cookiefunctionality. For settingCookieswith the same expiration asSession, refer to: Cookie#Cookie Session Expiry - Added
ALLMapmethod in group route registration for bulk route registration: Group Route#Bulk Registration - Introduced
CRSFplugin documentation: CSRF - Other feature and detail improvements.
- Improved
-
gdb- Added
Ctxmethod for asynchronousIOcontrol or custom context information transmission, especially for tracing: ORM - Context - Added
Rawtype for embedding rawSQLstatements which will directly submit to the underlying database driver without any processing: Writing#RawSQL Statement Embedding, Updating#RawSQL Statement Embedding - Improved
Fields/Fields/Datamethods with automatic mapping detection and filtering for inputmap/structparameters to database fields: ORM - Senior Features - Configurable
InsertedAt/UpdatedAt/DeletedAtfield names andTimeMaintainDisabledsetting added to disable time filling and soft delete features: ORM Model - Time Fields - Added
Counterupdate feature for incrementing/decrementing field values: Updating#Counter Update Feature - Improved
ORMtimezone processing; see: ORM - Timezone - Other performance and usability detail improvements.
- Improved some detail issues.
- Enhanced unit tests.
- Added
-
gerror- Added
Newf/NewSkipfmethods for creating error objects: Error Handling - Added support for error code features: Error Code - Example
- Enhanced unit tests.
- Added
-
gvalid- Added
phone-looseloose mobile number verification rule, allowing any11-digit number starting with13/14/15/16/17/18/19. - Validation errors implement the
gerrorCurrent() errorinterface, allowing the use ofgerror.Currentto get the current first validation error: Data Validation - Result - Other detail improvements.
- Enhanced unit tests.
- Added
-
gvar- Added
IsNil/IsEmptymethods to check if data isnil/empty. - Added
IsInt/IsUint/IsFloat/IsSlice/IsMap/IsStructcommon type checking methods. - Deprecated
StructDeep/StructDeepmethods, recommending to useStruct/Structsdirectly. - Enhanced unit tests.
- Added
-
ghtml- Added
SpecialCharsMapOrStructmethod for automatically convertingHTMLcode inmap/structkeys/attributes to preventXSS.
- Added
-
gjson- Deprecated
To*conversion methods, recommendingStructmethod instead ofToStruct. - Some detail improvements.
- Enhanced unit tests.
- Deprecated
-
internal- Improved and refined
internal/emptypackage's null value judgment. - Due to performance issues https://github.com/gogf/gf/issues/1004, temporarily removed the dependency of the
internal/jsonpackage on the third-party package github.com/json-iterator/go, reverting to using the standard libraryencoding/json. - Improved
internal/structspackage by removing the dependency on the third-party package github.com/gqcn/structs, simplifying the reflection processing logic, improving performance and usability, and enhancing long-term maintainability. - Added
RemoveSymbolsmethod in theinternal/utilspackage for removing special characters in a string. ImprovedEqualFoldWithoutCharsmethod by removing regex filtering of substrings, greatly enhancing method performance. These small functions contribute to improving the performance of other complex type conversion modules in the framework. Although theinternalpackage does not expose methods directly, it impacts the performance of some core components within the framework.
- Improved and refined
-
gcfg- Improved singleton instance configuration object retrieval with auto-detect file type feature: Configuration Management - Singleton Object#Auto-Retrieval Feature
- Other detail improvements.
-
gcmd
- Improved default parameter parsing retrieval method: Command
- Added
GetWithEnvmethod to retrieve from environment variables if a specified parameter is absent in the command line: Command
genv
- Added
SetMapmethod for batch setting environment variables. - Added
GetWithCmdmethod to retrieve from command line parameters if a specified parameter is absent in environment variables: Environment
gfile
- Deprecated
ReadByteLinesmethod; addedReadLinesBytesmethod. - Adjusted callback function definition of
ReadLines/ReadLinesBytesmethods to includeerrorreturn.
glog
- Improved rolling update functionality.
- Other detail improvements.
gsession
- Added
SetMapmethod for batch setting key-value pair data.
gtimer
- Improved constant naming to use PascalCase style.
gview
- Added built-in template function
mapto convert parameters tomap[string]interface{}type. - Added built-in template function
mapsto convert parameters to[]map[string]interface{}type. - Added built-in template function
jsonto convert parameters toJSONstring type. - Documented updates: Template Funcs - Built-In
- Other detail improvements.
gconv
- Performance improvements.
- Functionality improvements (many small detail improvements).
- More robust code.
- Enhanced unit tests.
gutil
- Added
Keysmethod to get keys/attribute names ofmap/structand return as an array. - Added
Valuesmethod to get values/attributes ofmap/structand return as an array. - Added
MapToSlicemethod, for example:{"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"] - Added
StructToSlicemethod, for example:{"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"] - Added
SliceToMapmethod, for example:["K1", "v1", "K2", "v2"] => {"K1": "v1", "K2": "v2"} - Enhanced unit tests.
- Other detail improvements.
Bug Fix
- Fixed concurrency safety issue in
Clonemethod ofgarray/gmap/gtree. - Fixed issue where
gpooldid not automatically invoke expiration method for expired elements when expiration method was set. - Fixed duplication issue in
gfile.ReadLines/ReadLineByteswhen reading large amounts of data. - Other bug fixes.