Skip to content

Commit

Permalink
util: fix vet (pingcap#23042)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored Mar 2, 2021
1 parent 80eed54 commit 2a5aa13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/hack/hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func String(b []byte) (s MutableString) {
// Use at your own risk.
func Slice(s string) (b []byte) {
pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b))
pstring := *(*reflect.StringHeader)(unsafe.Pointer(&s))
pstring := (*reflect.StringHeader)(unsafe.Pointer(&s))
pbytes.Data = pstring.Data
pbytes.Len = pstring.Len
pbytes.Cap = pstring.Len
Expand Down

0 comments on commit 2a5aa13

Please sign in to comment.