Skip to content

Commit

Permalink
chore(go): go-openapi requires go.1.20 across the board
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
  • Loading branch information
fredbi committed Mar 9, 2024
1 parent 5e655d8 commit 53e32e8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ require (
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

go 1.19
go 1.20
14 changes: 0 additions & 14 deletions string_bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@ package swag

import "unsafe"

type internalString struct {
Data unsafe.Pointer
Len int
}

// hackStringBytes returns the (unsafe) underlying bytes slice of a string.
func hackStringBytes(str string) []byte {
p := (*internalString)(unsafe.Pointer(&str)).Data
return unsafe.Slice((*byte)(p), len(str))
}

/*
* go1.20 version (for when go mod moves to a go1.20 requirement):
func hackStringBytes(str string) []byte {
return unsafe.Slice(unsafe.StringData(str), len(str))
}
*/

0 comments on commit 53e32e8

Please sign in to comment.