7 Commits

Author SHA1 Message Date
Flc゛
c4287b1300
ci(golangci-lint): update configuration and fix lint issues (#4247)
* ci: update golangci-lint configuration and lint settings

- Update golangci-lint to version 2
- Enable new linters and adjust existing ones
- Update lint settings across multiple test files
- Remove unused struct and variable checks
- Add new lint exclusions for generated code and specific directories

Signed-off-by: Flc <four_leaf_clover@foxmail.com>

* ci(github): update golangci-lint-action to v8 and lint version to v2.3.4

Signed-off-by: Flc <four_leaf_clover@foxmail.com>

* ci: downgrade golangci-lint to v2.1.6

Signed-off-by: Flc <four_leaf_clover@foxmail.com>

* ci(golangci): add gofumpt linter and fix related issues- Added gofumpt linter to .golangci.yml

Signed-off-by: Flc <four_leaf_clover@foxmail.com>

* test: ignore testifylint and gofumpt lints in specific test cases

Signed-off-by: Flc <four_leaf_clover@foxmail.com>

* build(deps): remove golang.org/x/lint

- Remove golang.org/x/lint package from go.mod
- Update related dependencies in go.sum

Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>

* build(deps): downgrade golang.org/x/mod and golang.org/x/tools

- Downgrade golang.org/x/mod from v0.24.0 to v0.18.0
- Downgrade golang.org/x/tools from v0.33.0 to v.22.0

These changes are made to address compatibility issues with the current project setup.

Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>

---------

Signed-off-by: Flc <four_leaf_clover@foxmail.com>
Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>
2025-05-23 14:46:48 +08:00
Bo-Yi Wu
b1c1e7b572
ci: update Go version requirements and remove test files (#3957)
- Update the Go version requirements in `.github/workflows/gin.yml`
- Remove test files for Go versions 1.18 and 1.19
- Update the required Go version in `debug.go` and `debug_test.go`
- Rename and modify files related to Go version 1.19 and 1.20 in the `internal/bytesconv` directory

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-08 10:14:42 +08:00
hopehook
a889c58de7
Convert strings and slices using the officially recommended way (#3344)
* Feat: Convert strings and slices using the officially recommended way.

Go official is expected to provide unsafe.{SliceData, Slice, StringData,
String} series methods in version 1.20 for conversion of strings and
slices.

* chore: add reference documentation link to comment of code

* chore: update Copyright

* chore: remove build tag "+build !go1.20"
2023-03-02 08:12:20 +08:00
Andy Pan
1bdf86b722
Remove the tedious named return value (#2620)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2021-02-08 23:24:22 +08:00
thinkerou
3b5e861bb1
fix compile error from #2572 (#2600) 2021-01-03 21:14:56 +08:00
thinkerou
2773ce6e60
add copyright (#2388)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-23 22:52:01 +08:00
Andy Pan
982daeb1ec Use zero-copy approach to convert types between string and byte… (#2206)
* Use zero-copy approach to convert types between string and byte slice

* Rename argument to a eligible one

Benchmark:

BenchmarkBytesConvBytesToStrRaw-4   	21003800	        70.9 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvBytesToStr-4      	1000000000	         0.333 ns/op	       0 B/op	       0 allocs/op
BenchmarkBytesConvStrToBytesRaw-4   	18478059	        59.3 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvStrToBytes-4      	1000000000	         0.373 ns/op	       0 B/op	       0 allocs/op


Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-01-18 00:32:50 +08:00