3 // Copyright 2022 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
17 sh1 := (*reflect.StringHeader)(unsafe.Pointer(&s))
18 ptr2 := unsafe.Pointer(unsafe.StringData(s))
19 if ptr2 != unsafe.Pointer(sh1.Data) {
20 panic(fmt.Errorf("unsafe.StringData ret %p != %p", ptr2, unsafe.Pointer(sh1.Data)))