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

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:

  • GoFrame was selected by OSC Open Source China as one of the TOP30 open source projects of 2020: https://www.oschina.net/question/2918182_2320114. Thank you for your recognition and support! Meanwhile, GoFrame is also a Gitee GVP Most Valuable Project.
  • The official website of GoFrame has 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 Go language, you can compare GoFrame to Laravel in PHP, SpringBoot in Java, or Django in Python.

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

  1. ghttp

    • Improved HTTPClient GET request methods, automatically constructing parameters as QueryString instead of Body to ensure compatibility with other servers.
    • Added default value setting feature to Request objects: Request - Default Value
    • Added Request.SetCtx method for custom context variables, commonly used in middleware/interceptors: Request - Context
    • Added Request variable in template parsing to get client request parameters regardless of QueryString/Form type: Response - Template Parsing
    • Improved Cookie functionality. For setting Cookies with the same expiration as Session, refer to: Cookie#Cookie Session Expiry
    • Added ALLMap method in group route registration for bulk route registration: Group Route#Bulk Registration
    • Introduced CRSF plugin documentation: CSRF
    • Other feature and detail improvements.
  2. gdb

    • Added Ctx method for asynchronous IO control or custom context information transmission, especially for tracing: ORM - Context
    • Added Raw type for embedding raw SQL statements which will directly submit to the underlying database driver without any processing: Writing#RawSQL Statement Embedding, Updating#RawSQL Statement Embedding
    • Improved Fields/Fields/Data methods with automatic mapping detection and filtering for input map/struct parameters to database fields: ORM - Senior Features
    • Configurable InsertedAt/UpdatedAt/DeletedAt field names and TimeMaintainDisabled setting added to disable time filling and soft delete features: ORM Model - Time Fields
    • Added Counter update feature for incrementing/decrementing field values: Updating#Counter Update Feature
    • Improved ORM timezone processing; see: ORM - Timezone
    • Other performance and usability detail improvements.
    • Improved some detail issues.
    • Enhanced unit tests.
  3. gerror

  4. gvalid

    • Added phone-loose loose mobile number verification rule, allowing any 11-digit number starting with 13/14/15/16/17/18/19.
    • Validation errors implement the gerror Current() error interface, allowing the use of gerror.Current to get the current first validation error: Data Validation - Result
    • Other detail improvements.
    • Enhanced unit tests.
  5. gvar

    • Added IsNil/IsEmpty methods to check if data is nil/empty.
    • Added IsInt/IsUint/IsFloat/IsSlice/IsMap/IsStruct common type checking methods.
    • Deprecated StructDeep/StructDeep methods, recommending to use Struct/Structs directly.
    • Enhanced unit tests.
  6. ghtml

    • Added SpecialCharsMapOrStruct method for automatically converting HTML code in map/struct keys/attributes to prevent XSS.
  7. gjson

    • Deprecated To* conversion methods, recommending Struct method instead of ToStruct.
    • Some detail improvements.
    • Enhanced unit tests.
  8. internal

    • Improved and refined internal/empty package's null value judgment.
    • Due to performance issues https://github.com/gogf/gf/issues/1004, temporarily removed the dependency of the internal/json package on the third-party package github.com/json-iterator/go, reverting to using the standard library encoding/json.
    • Improved internal/structs package 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 RemoveSymbols method in the internal/utils package for removing special characters in a string. Improved EqualFoldWithoutChars method 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 the internal package does not expose methods directly, it impacts the performance of some core components within the framework.
  9. gcfg

  10. gcmd

  • Improved default parameter parsing retrieval method: Command
  • Added GetWithEnv method to retrieve from environment variables if a specified parameter is absent in the command line: Command
  1. genv
  • Added SetMap method for batch setting environment variables.
  • Added GetWithCmd method to retrieve from command line parameters if a specified parameter is absent in environment variables: Environment
  1. gfile
  • Deprecated ReadByteLines method; added ReadLinesBytes method.
  • Adjusted callback function definition of ReadLines/ReadLinesBytes methods to include error return.
  1. glog
  • Improved rolling update functionality.
  • Other detail improvements.
  1. gsession
  • Added SetMap method for batch setting key-value pair data.
  1. gtimer
  • Improved constant naming to use PascalCase style.
  1. gview
  • Added built-in template function map to convert parameters to map[string]interface{} type.
  • Added built-in template function maps to convert parameters to []map[string]interface{} type.
  • Added built-in template function json to convert parameters to JSON string type.
  • Documented updates: Template Funcs - Built-In
  • Other detail improvements.
  1. gconv
  • Performance improvements.
  • Functionality improvements (many small detail improvements).
  • More robust code.
  • Enhanced unit tests.
  1. gutil
  • Added Keys method to get keys/attribute names of map/struct and return as an array.
  • Added Values method to get values/attributes of map/struct and return as an array.
  • Added MapToSlice method, for example: {"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"]
  • Added StructToSlice method, for example: {"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"]
  • Added SliceToMap method, for example: ["K1", "v1", "K2", "v2"] => {"K1": "v1", "K2": "v2"}
  • Enhanced unit tests.
  • Other detail improvements.

Bug Fix

  1. Fixed concurrency safety issue in Clone method of garray/gmap/gtree.
  2. Fixed issue where gpool did not automatically invoke expiration method for expired elements when expiration method was set.
  3. Fixed duplication issue in gfile.ReadLines/ReadLineBytes when reading large amounts of data.
  4. Other bug fixes.