Skip to content

Commit

Permalink
style(lint): refactor codebase for improved performance and maintaina…
Browse files Browse the repository at this point in the history
…bility

- Add `//nolint` comment to suppress linter warning for unsafe pointer conversion

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Oct 25, 2024
1 parent ab0df18 commit 7522fdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion convert/strings_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func bytesToString(bytes []byte) (s string) {
if len(bytes) == 0 {
return s
}
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) //nolint
sh.Data = uintptr(unsafe.Pointer(&bytes[0]))
sh.Len = len(bytes)
return s
Expand Down

0 comments on commit 7522fdb

Please sign in to comment.