mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 11:51:16 -06:00
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.17.1 to 2.17.2. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.17.1...v2.17.2) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
23 lines
378 B
Go
23 lines
378 B
Go
//go:build !purego
|
|
// +build !purego
|
|
|
|
package ws
|
|
|
|
import (
|
|
"reflect"
|
|
"unsafe"
|
|
)
|
|
|
|
func strToBytes(str string) (bts []byte) {
|
|
s := (*reflect.StringHeader)(unsafe.Pointer(&str))
|
|
b := (*reflect.SliceHeader)(unsafe.Pointer(&bts))
|
|
b.Data = s.Data
|
|
b.Len = s.Len
|
|
b.Cap = s.Len
|
|
return bts
|
|
}
|
|
|
|
func btsToString(bts []byte) (str string) {
|
|
return *(*string)(unsafe.Pointer(&bts))
|
|
}
|