diff options
Diffstat (limited to 'vendor/github.com/go-openapi/swag/string_bytes.go')
-rw-r--r-- | vendor/github.com/go-openapi/swag/string_bytes.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/string_bytes.go new file mode 100644 index 000000000..90745d5ca --- /dev/null +++ b/vendor/github.com/go-openapi/swag/string_bytes.go @@ -0,0 +1,8 @@ +package swag + +import "unsafe" + +// hackStringBytes returns the (unsafe) underlying bytes slice of a string. +func hackStringBytes(str string) []byte { + return unsafe.Slice(unsafe.StringData(str), len(str)) +} |