Commit Graph

48 Commits

Author SHA1 Message Date
ee24da4e72 refactor: interface{} to any and reflect.Ptr to reflect.Pointer (#4395)
This pull request standardizes the use of the Go 1.18+ `any` type alias
instead of `interface{}` throughout the codebase. The change improves
code readability and aligns with modern Go best practices. The update
touches many files, including core data structures, code generation
templates, logging utilities, and test data, ensuring consistency across
all usages.

**Type alias migration to `any`:**

* Replaced all instances of `interface{}` with `any` in core data
structures such as `garray` and in generated model structs (e.g.,
`TableUser`, `User1`, `User2`) to modernize type usage.
[[1]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L31-R31)
[[2]](diffhunk://#diff-6c19859cb32c7516ea95ddc8f8235460818eb2f24d2204308e0d9e1b19e7d90fL15-R19)
[[3]](diffhunk://#diff-a15ba2f5e830b4833c47b902515a4f9e5a4f83a3707698f3229b307ec3776b41L15-R18)
[[4]](diffhunk://#diff-52e0837e84d49221d1b810d88fdf78221f36cffcd664fb42f8aba49a79b974dcL15-R19)
[[5]](diffhunk://#diff-11c3457d1a23a4ca6ecd00d6b856289774936b6a708384cf03aff164044e7546L15-R19)
[[6]](diffhunk://#diff-2cff9cf8e6a0cc34087326d8c8149c3bbaf74c76fdbdf5a73daed13cc04249e1L15-R19)
* Updated function signatures, method parameters, and return types from
`interface{}` to `any` in various parts of the codebase, including code
generation, service logic, and logging utilities (e.g., `mlog`).
[[1]](diffhunk://#diff-175edfeea54490b8fe4e18ffcbea5835efaf8f0b8acf623359073987cae7eb76L48-R55)
[[2]](diffhunk://#diff-2b1953fb78cf3593d8c2c7d911e95b65fd0b847c30ed0b4d167d16fe6d781235L54-R74)
[[3]](diffhunk://#diff-e001b7a4b63603b9b14f00de78a4d570bb76c5f57d856a24643f071032e12356L66-R73)
[[4]](diffhunk://#diff-5582954e8a9983988dc8854ad82067fb2ac6269b988e07357ad8db1dfec5f1a0L39-R41)
[[5]](diffhunk://#diff-c5d51d56f487779a2b6207c7ad26c7a20bbadcc846ce094fe60ab4cabff58c51L107-R107)
[[6]](diffhunk://#diff-f96e6a9fdb416eb1804ceaba1fe0ac637bff22c43837f8bb849c2366ce72d4a1L116-R121)
[[7]](diffhunk://#diff-f94c83a1b08ae060d9346f4a6031fc4a7b9a0b894e02d9afaa09018b6598eac0L112-R112)
[[8]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L36-R36)
[[9]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L74-R74)
[[10]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L96-R96)

**Generated code and templates:**

* Adjusted generated files and code generation templates to output `any`
instead of `interface{}` for relevant struct fields and function
signatures, ensuring that new code generation aligns with the updated
convention.
[[1]](diffhunk://#diff-6c19859cb32c7516ea95ddc8f8235460818eb2f24d2204308e0d9e1b19e7d90fL15-R19)
[[2]](diffhunk://#diff-a15ba2f5e830b4833c47b902515a4f9e5a4f83a3707698f3229b307ec3776b41L15-R18)
[[3]](diffhunk://#diff-52e0837e84d49221d1b810d88fdf78221f36cffcd664fb42f8aba49a79b974dcL15-R19)
[[4]](diffhunk://#diff-11c3457d1a23a4ca6ecd00d6b856289774936b6a708384cf03aff164044e7546L15-R19)
[[5]](diffhunk://#diff-2cff9cf8e6a0cc34087326d8c8149c3bbaf74c76fdbdf5a73daed13cc04249e1L15-R19)
[[6]](diffhunk://#diff-175edfeea54490b8fe4e18ffcbea5835efaf8f0b8acf623359073987cae7eb76L48-R55)
[[7]](diffhunk://#diff-e001b7a4b63603b9b14f00de78a4d570bb76c5f57d856a24643f071032e12356L66-R73)
[[8]](diffhunk://#diff-5582954e8a9983988dc8854ad82067fb2ac6269b988e07357ad8db1dfec5f1a0L39-R41)

**Container and utility updates:**

* Refactored the `garray` container implementation and related
constructors/methods to use `[]any` instead of `[]interface{}`, along
with corresponding function signatures.
[[1]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L31-R31)
[[2]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L52-R52)
[[3]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L62-R62)
[[4]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L73-R86)
[[5]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L96-R97)
[[6]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L107-R114)
[[7]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L124-R124)
[[8]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L135-R143)
[[9]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L167-R167)

These changes collectively modernize the codebase and prepare it for
future Go developments by using the idiomatic `any` type.
2025-08-28 16:53:19 +08:00
00e2f6b5dc chore: improve golangci-lint.yml, upgrade dependencies, and optimize code and comments (#4025) 2024-12-11 10:14:12 +08:00
b0b84a3937 ci(gci/import): improve golangci.yml and add gci linter (#4010) 2024-12-07 14:17:33 +08:00
8669512f42 feat: add metric feature support in goframe (#3138) 2024-03-24 21:18:30 +08:00
a8713da97f enhance: cut tracing content as unicode for safety (#3342) 2024-03-13 19:21:16 +08:00
1793bf0863 add golangci feature to guarantee codes quality (#2229) 2022-11-01 20:12:21 +08:00
dba903c13b add WithUUID for package gtrace (#2176)
* add WithUUID for package gtrace

* feat: improve import

Co-authored-by: houseme <housemecn@gmail.com>
2022-10-08 21:44:42 +08:00
c866b5005f fix error message for package gtrace (#2103) 2022-08-31 19:53:21 +08:00
2c169e2330 improve package glog; fix issue in package gtrace (#1952) 2022-06-28 15:47:16 +08:00
0d8952dcde improve WithTraceID function for package gtrace 2022-06-06 21:36:30 +08:00
25bdf10cc8 feat:improve tracing 2021-12-19 00:44:31 +08:00
77422f71f7 add fnction MustSet/MusetSetMap for package gsession 2021-12-18 14:10:55 +08:00
f583f28953 rename SetTraceID to WithTraceID for package gtrace 2021-12-17 01:27:24 +08:00
b6d60fc209 downgrade otel version to v1.0.0 2021-12-17 00:55:48 +08:00
8f24dc3549 add SetTraceID for package gtrace 2021-12-17 00:06:38 +08:00
aee52fd56e enable OpenTelemetry in default for some core components 2021-12-16 23:09:37 +08:00
34e7913268 add internal logging for package gtrace 2021-12-10 23:26:53 +08:00
3f24159636 add tracing configuration switch for whole framework 2021-12-10 18:08:36 +08:00
5ed5adc6df feat:add trace db.statement、host.name 2021-12-02 18:54:56 +08:00
35cf228d83 add AdapterRedis for package gcache 2021-11-27 01:10:00 +08:00
57ccc13e0c unit testing files renaming 2021-11-17 23:20:58 +08:00
e86ee052cb improve code import 2021-11-16 19:29:02 +08:00
be03b3cdda Improved import, by group improt. 2021-11-13 23:23:55 +08:00
1bc0635f8b version 2 2021-10-11 21:41:56 +08:00
b2629b9bfa comment update for package gtrace 2021-09-22 19:12:31 +08:00
cbe704333a [feature] upgrade opentelemetry version v1.0.0 map to string 2021-09-22 14:54:42 +08:00
9d67cb4f34 [feature] upgrade opentelemetry version v1.0.0 2021-09-21 15:15:37 +08:00
ff70e54e3e fix unit testing case for package gtrace 2021-08-02 09:50:44 +08:00
c42a9d6e50 Merge pull request #1316 from qinyuguang/otel
Otel
2021-06-29 13:05:38 +08:00
083e32fd9e otel version bump to v1.0.0-RC1 2021-06-28 13:36:37 +08:00
c25f88293b unify command or enviroment key names for packages 2021-06-26 12:08:18 +08:00
7003c284d0 replace json.Unmarshal with json.UnmarshalUseNumber for packages 2021-05-15 22:38:07 +08:00
ae5ecb5bfa update unit testing case for package gtrace 2021-03-29 16:12:14 +08:00
6f1340ce36 upgrade otel from v0.18.0 to v0.19.0 2021-03-29 16:00:56 +08:00
9ed8d8c113 rename max content log size name for gtrace from maxlogsize to maxcontentlogsize 2021-03-18 11:22:44 +08:00
6a24b595f0 upgrade otel from 0.16.0 to 0.18.0 2021-03-18 10:39:23 +08:00
6135085d61 improve package gtrace 2021-02-03 15:27:41 +08:00
40bdc76af1 improve package gtrace 2021-02-03 15:14:07 +08:00
8368e11827 merge develop 2021-02-01 17:14:08 +08:00
e6b4662ec2 improve tracing feature 2021-02-01 17:10:50 +08:00
2451b40d3e improve package gtrace 2021-01-28 13:11:09 +08:00
152c472bc2 add common tracing labels 2021-01-27 19:24:04 +08:00
8f6f17c341 add common tracing labels 2021-01-27 19:15:14 +08:00
f2fe084988 improve tracing feature 2021-01-27 13:28:12 +08:00
c72c7dbe9a improve tracing feature 2021-01-26 16:06:20 +08:00
cc1e340585 add tracing middleware for ghttp.Client/Server; add package gtrace 2021-01-25 18:43:47 +08:00
3f2ae3ba62 add tracing feature for ghttp.Client 2021-01-25 14:54:38 +08:00
c27ddb1d79 opentelemetry 2021-01-22 23:04:29 +08:00