New Features and Improvements
- The framework currently has
69
development modules (excluding internal modules), with native code of65302
lines (excluding third-party dependency packages), and unit test coverage reaching77%
; - Added
gerror
error handling module: https://goframe.org/errors/gerror/index - Improved
gcharset
character encoding conversion module, supporting more character sets: https://goframe.org/encoding/gcharset/index - Added
gmutex
module, an advanced mutex module based onchannel
, supporting more rich mutex features: https://goframe.org/os/gmutex/index - Improved
glog
logging module:- Added asynchronous logging output feature: https://goframe.org/os/glog/async
- Added
Flags
extra feature: https://goframe.org/os/glog/flags - Added
Json
data format output: https://goframe.org/os/glog/json - Added custom
Writer
interface feature: https://goframe.org/os/glog/writer - Renamed
Backtrace
toStack
and improved call stack output format; - Added
Expose
method to expose the internal defaultLogger
object;
- Improved
gdb
database ORM module:- Improved error handling, returning
sql.ErrNoRows
when no data is found in a database operation: https://goframe.org/database/gdb/error - Improved
Update
/Delete
methods to supportOrder BY
andLIMIT
features; - In database chain operations, the parameter supports
slice
parameters: https://goframe.org/database/gdb/model/model - Renamed
Priority
weight configuration toWeight
; - Added
Debug
configuration to enable/disable debugging feature: https://goframe.org/database/gdb/config - Added
Offset
method, an optional chain operation method, withpgsql
database directly recognizing the second parameter ofLimit
method asOffset
syntax; - Improved database dynamic switching feature to switch between different database types;
- Simplified configuration file structure: https://goframe.org/database/gdb/config
- Improved error handling, returning
- Improved
gconv
data conversion module:- Supported more tags during struct object conversion:
gconv/c/json
; - Supported
*struct/[]struct/[]*struct
automatic initialization and creation: https://goframe.org/util/gconv/struct - Added
Strusts/StrctsDeep
methods for recursive conversion of struct arrays; - Added
StructDeep
method for recursive conversion of struct objects; - Added
MapDeep
method for recursive conversion of struct properties;
- Supported more tags during struct object conversion:
- Improved
ghttp
module:- Improved the group routing function of
ghttp
module with more robust logic handling; - Improved
ghttp.Request.Get*ToStruct
methods to supportparams/param/p
tags and recursive struct conversion, with automatic initialization for**struct
parameters; - Adjusted
ghttp.CORSDefault
cross-origin settings, withAllowOrigin
set to*
;
- Improved the group routing function of
- Improved
gvalid
data validation module:- Added support for validation tags
gvalid/valid/v
; - Improved
CheckStruct
to support recursive validation of struct objects: https://goframe.org/util/gvalid/checkstruct
- Added support for validation tags
- Improved
gtcp
TCP communication module:- Improved communication packet protocol design for more lightweight and efficient packages: https://goframe.org/net/gtcp/conn/pkg
- Added
TLS
support toTCP Server
: https://goframe.org/net/gtcp/tls - Added
Server.Cloce
server closing method;
- Improved
gproc
module communication data structure, usinggtcp
lightweight packet protocol to optimize message sending logic; - Improved
gqueue
module with data synchronization buffer mechanism to address memory usage and latency issues under large data volumes; - Improved
gmlock
module, replacing internal mutexes usinggmutex
, and added more operation methods; - Improved
gaes
encryption module by addingCBC
encryption/decryption methods; - Improved
garray.Range/SubSlice
methods for better design and performance; - Improved
gjson
/gparser
modules to implementMarshalJSON
interface for customJSON
data format conversion; - Added
error
variables to return method results incrypto
classification to ensure more rigorous interface design style; - Changed input/output types in
gbase64
module, adding several related methods; - Changed
UnLock
toUnlock
ingflock
, and addedIsRLocked
method; - Added
gfile.CopyFile/CopyDir
methods for file and directory copying; - Added more type conversion methods to
gjson/gparser/gvar/gcfg
modules; - Improved
gcache
module, with expiration time parameter supportingtime.Duration
type; - Added
internal/structs
, a powerful and convenient struct parser, optimizing all modules involving struct reflection processing; - Improved
gbinary
, adding support forBigEndian
with encapsulated methods;
Bug Fixes
- Fixed
garray.Search
return value issue; - Fixed logic issues in
garray.Contains
,garray.New*ArrayFromCopy
methods; - Fixed
gjson.Remove
slice parameter issue; - Fixed
gtree.AVLTree.Remove
method return value issue; - Fixed inaccurate size issue in
gqueue.Size
; - Fixed
queue.Close
issue; - Fixed deadlock issue in
gcache.GetOrSetLockFunc
when callback function returnsnil
result; - Fixed default recursive monitoring addition issue in
gfsnotify.Add
method; - Fixed issues with
gdb.Model.Scan
for certain parameter types;
Notes
Please pay attention to the bold parts above, as you may encounter incompatibilities when upgrading.