Skip to main content
Version: 2.8.x(Latest)

Hello everyone, the GoFrame framework has officially released version v2.4.0 today! 👏👏👏👏

The biggest highlight of this version is the provision of features for microservices development, development tools, and project scaffolding, along with comprehensive microservices development documentation!! The design of microservices components continues to focus primarily on interface design to ensure good flexibility and extensibility. The interfaces are maintained in the main repository of the framework, while specific interface implementations are pragmatic and provided within community components.

In fact, the feature functionality of this version has long been Ready, but due to the significant workload of documentation, it took about a month to complete it relatively thoroughly, thus adjusting the release date of the version accordingly. We believe that documentation is as important as code and is an integral part of a milestone release. We know how to use it well and hope to tell everyone how to use it well, to more pragmatically help more developers. This is one reason why GoFrame framework documentation has been able to accumulate abundantly over time. Furthermore, complete source code comments are primarily in English to assist overseas users. The official website documentation remains predominantly in Chinese to support major development teams in the Greater China region.

Come and check out what we've updated! Enjoy! 🍺🍺🍺🍺🍺🍺🍺🍺

Full code changes: v2.3.0...v2.4.0, thanks to all the contributing developers for this release:

New Features

Official release of microservices development features and addition of a complete microservices development section on the official website: Microservice Development

Functional Improvements

Database Component

  1. gdb
  2. Fixed the issue of automatic table structure query failure during cross-database operations: https://github.com/gogf/gf/issues/2338
  3. Fixed the Namespace configuration issue not taking effect under pgsql.
  4. Fixed the issue of being unable to open sqlite database files when using the new unified configuration: https://github.com/gogf/gf/issues/2435
  5. Improved underlying database operation return logic, returning underlying errors through gerror.Wrap to ensure that the upper layer can obtain underlying custom error objects.
  6. Fixed the issue of unsigned integer fields being converted to signed integer types when querying data tables: https://github.com/gogf/gf/issues/2356
  7. Fixed parsing issue of multi-level Model being used as subquery parameters during subqueries: https://github.com/gogf/gf/issues/2339
  8. Improved time maintenance feature, enabling the writing of full time (granularity down to nanoseconds) for write/update/delete operations.
  9. Fixed unlimited execution issue under soft delete scenarios when given an empty Where condition: https://github.com/gogf/gf/issues/2427
  10. gredis
  11. Fixed configuration handling and object initialization issues when creating objects.

Container Component

  1. garray
  2. Added Filter method for customizing traversal and filtering of array elements.
  3. Added RemoveValues method to support batch deletion of elements by parameter value.
  4. Improved InsertBefore method to support batch parameter insertion capability.
  5. gmap
  6. Added IsSubOf method to determine if the current map is a subset of the specified map.
  7. gqueue
  8. Fixed Len/Size length calculation issue: https://github.com/gogf/gf/issues/2509
  9. Fixed concurrent safety issue with Close method: https://github.com/gogf/gf/issues/2015

Network Component

  1. gclient
  2. Added SetDiscovery and SetBuilder methods to allow callers to customize client service discovery and load balancing interface implementations.
  3. ghttp
  4. Improved support for reading specified parameters from Header/Cookie when receiving parameters, supporting the specification of reading Header/Cookie in the route's in tag (in:header/cookie).
  5. Improved ResponseWriter to implement the http.Flusher interface, simplifying the user's Stream output development logic: Response - Streaming
  6. Improved link tracing implementation logic to prevent issues from being ignored when an error occurs in reading submitted content internally.
  7. Improved parameter reading logic to prevent r.GetRequestMap() from returning content that includes form-data form body information: https://github.com/gogf/gf/issues/2261
  8. Improved internal context reception logic:
    1. Original logic: Removed ignoring of the underlying Request ctx and created a new ctx supporting link tracing.
    2. Latest logic: Inherits the ctx object of the underlying Request and extends this ctx to support link tracing features.
  9. Improved graceful shutdown logic to allow customizing the timeout of graceful shutdown.
  10. Improved configuration feature to allow developers to configure custom service registration interface implementation objects.

System Component

  1. gcmd
  2. Improved AddObject method to allow directly adding specified *Command or standardized Object objects as subcommands.
  3. gctx
  4. Fixed missing TraceID issue in GetInitCtx method: Context
  5. gfile
  6. Improved Temp method to align basic logic implementation with standard library os.TempDir, avoiding temporary directory conflict issues during single-machine collaboration.
  7. gtimer
  8. Added Quick option when creating timers to trigger the specified callback method upon adding timers.

Utility Component

  1. gconv
  2. Fixed Scan method conversion failure issue in certain scenarios when fields are integer/floating point arrays: https://github.com/gogf/gf/issues/2391
  3. Fixed issue of Interfaces method directly returning [] when attribute is 0: https://github.com/gogf/gf/issues/2395
  4. Fixed conversion issue when json tag is ,omitempty without variable name.
  5. Fixed conversion failure issue when target type is a pointer to a custom basic type.
  6. Fixed conversion failure issue of gvar.Var type to common third-party package decimal.Decimal type: https://github.com/gogf/gf/issues/2584
  7. Improved Struct method to resolve conversion failure issue when field type is time.Time/*time.Time and provided conversion value is a non-standard library-supported string like 2022-12-15 16:11:34: https://github.com/gogf/gf/issues/2371
  8. gtag
  9. Added SetGlobalEnums/GetEnumsByType methods for automated Golang Enums management. Requires gf gen enums command to work.
  10. gutil
  11. Fixed null pointer error issue in Dump method under certain scenarios: https://github.com/gogf/gf/issues/2487
  12. gvalid
  13. Added Field field in custom validation method parameters to address field missing issues in custom validation error prompts: https://github.com/gogf/gf/issues/2499

Community Component

Database Driver

  1. Improved dm/mysql component to resolve QueryEscape issue when special characters (e.g., /) exist in timezone configuration.

NoSQL Adapter

  1. Fixed missing connection pool configuration parameters in redis component configuration.

Service Registration Discovery

  1. Added file registration discovery component for file-based service registration discovery locally, typically used for single-node testing.
  2. Improved implementation details of etcd/polaris/zookeeper and refined single test cases.

Microservice Scaffolding

  1. Added grpcx microservice component for microservice development using the grpc communication protocol: Microservice Development

Development Tools

  1. Added gf gen pb command for compiling proto files to generate go pb files: Protobuf Compilation
  2. Added gf gen pbentity command for automatically generating proto data structure definition files for database tables: DB Table To Protobuf
  3. Added gf gen enums command for parsing specified directory go files and automatically generating enums data files based on enumeration definition specifications, mainly used for OpenAPI interface documentation display (experimental feature): Enums Maintenance
  4. Improved gf up command by adding tool CLI automatic upgrade feature.
  5. Improved gf gen service command to stop auto-generating methods into the interface definition file after the method's comment.
  6. Improved gf build command by adding DumpENV option to control whether to print environment information used during compilation, with default setting off.
  7. Improved gf docker command by adding Tag option to ensure compatibility with older versions.