From 53e32e82f758c8e884819330a87aef294ff10c1f Mon Sep 17 00:00:00 2001 From: Frederic BIDON Date: Sat, 9 Mar 2024 19:08:07 +0100 Subject: [PATCH] chore(go): go-openapi requires go.1.20 across the board Signed-off-by: Frederic BIDON --- go.mod | 2 +- string_bytes.go | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 5d2ec2c..9bc12e9 100644 --- a/go.mod +++ b/go.mod @@ -14,4 +14,4 @@ require ( gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) -go 1.19 +go 1.20 diff --git a/string_bytes.go b/string_bytes.go index c52d6bf..90745d5 100644 --- a/string_bytes.go +++ b/string_bytes.go @@ -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)) } -*/