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

This version is actually the major release of v2.0. To avoid the strict requirement of go module mechanism for v2 and above versions needing to modify import and add v2 suffix, it was released using v1.9.

New Features

  1. Added gf command line development assistant tool: https://goframe.org/toolchain/cli
  2. Added gres resource manager module: https://goframe.org/os/gres/index
  3. Refactored Session functionality, added gsession module, and WebServer defaults to file storage Session: https://goframe.org/net/ghttp/session
  4. WebServer added middleware feature, retaining the original HOOK design, both can achieve request interception, pre-processing, etc.: https://goframe.org/net/ghttp/router/middleware
  5. Added gi18n localization management module: https://goframe.org/i18n/gi18n/index
  6. Added gini module: https://goframe.org/encoding/gini/index
  7. WebServer added more convenient hierarchical routing registration method: https://goframe.org/net/ghttp/group/level
  8. gcmd command line parameter parsing module refactored, added Parser parsing object: https://goframe.org/os/gcmd/index
  9. Added gdebug module for stack information retrieval/printing: https://goframe.org/debug/gdebug/index

Major Adjustments

  1. Removed methods marked as deprecated in 1.x versions;
  2. Adjusted container classification modules to default to non-concurrent safety;
  3. Directory adjustments:
    • Removed third directory, unified management of package dependencies with go module;
    • Moved original modules in g directory to framework main directory, original g module moved to frame/g directory;
    • Changed original geg sample code directory name to .example;

Functional Improvements

  1. ghttp
    • Improved Request parameter parsing method: https://goframe.org/net/ghttp/request
    • Improved cross-domain request functionality, added Origin setting and verification feature: https://goframe.org/net/ghttp/cors
    • Changed TTL configuration data type of Cookie and Session to time.Duration;
    • Added simultaneous transmission of SessionId through Header/Cookie;
    • Added ConfigFromMap/SetConfigWithMap methods to configure WebServer with map parameter;
    • Improved default CORS configuration with default support for common Header parameters;
    • Added IsExitError method for developers to customize recover error handling, filtering non-exception errors defined by the framework;
    • Added SetSessionStorage configuration method for custom Session storage;
    • ghttp.Request added more parameter retrieval methods;
  2. gdb
    • Added automatic escape (Quote) feature for some SQL fields;
    • Added support for slice parameters in method operations and chain operations;
    • Added SetLogger method for custom database log printing;
    • Added Master/Slave method for selecting master-slave nodes for database operations;
    • Added unit tests for mssql/pgsql/oracle;
    • Supported full integration parameterized SQL statement debugging printing in debug mode;
    • Added more functional methods;
  3. glog
    • Added Default method to get the default Logger object;
    • Added StackWithFilter method for custom stack printing filtering;
    • Added more functional methods;
  4. gfile
    • Renamed some methods: Get/PutBinContents changed to Get/PutBytes;
    • Added ScanDirFile method for retrieving file directories only, supporting recursive search;
    • Added more functional methods;
  5. gview
    • Added SetI18n method for setting custom gi18n localization objects for view objects;
    • Added built-in support for gres resource manager;
  6. gcompress
    • Added file/directory compression/decompression methods for zip algorithm;
    • Compression parameters support multiple paths for file/directory;
  7. gconv
    • Improved support for []byte data type parameters;
    • Added Unsafe conversion method for increased conversion efficiency in specific scenarios;
    • Added MapDeep/StructDeep/StructsDeep methods for recursive struct conversion;
  8. gjson/gparser
    • Improved automatic type recognition functionality;
    • Added LoadJson/LoadXml/LoadToml/LoadYaml/LoadIni methods for custom data type content loading;
    • Added more functional methods;
  9. gerror
    • Improved error stack retrieval logic;
    • Added more functional methods;
  10. gmap/garray/gset/glist/gvar
    • Improved concurrent safety benchmarking scripts;
    • Changed garray.StringArray to garray.StrArray;
    • Added more functional methods;
  11. gdes
    • Standardized method name changes;
  12. gstr
    • Added Camel/Snake naming conversion methods;
    • Added more functional methods;
  13. genv
    • Added more functional methods;

Bug Fix

  1. Fixed issue with gvalid customization tag errors not working when validating struct;
  2. Fixed automatic content type recognition failure in gcfg configuration management module under specific conditions;
  3. Fixed concurrent safety issue in gqueue when the user actively closes the queue;
  4. Fixed integer overflow issue in session when developer sets excessively large TTL.