mirror of
https://github.com/golang/go.git
synced 2026-04-03 17:59:55 +09:00
reflect: deprecate SliceHeader and StringHeader
These are replaced by unsafe.String etc, which were added in Go 1.20. Per https://go.dev/wiki/Deprecated, we must wait until Go 1.21 to mark them deprecated. Fixes #56906. Change-Id: I4198c3f3456e9e2031f6c7232842e187e6448892 Reviewed-on: https://go-review.googlesource.com/c/go/+/452762 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Russ Cox <rsc@golang.org>
This commit is contained in:
2
api/next/56906.txt
Normal file
2
api/next/56906.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg reflect, type SliceHeader //deprecated #56906
|
||||
pkg reflect, type StringHeader //deprecated #56906
|
||||
@@ -2743,7 +2743,7 @@ func (v Value) UnsafePointer() unsafe.Pointer {
|
||||
// it references will not be garbage collected, so programs must keep
|
||||
// a separate, correctly typed pointer to the underlying data.
|
||||
//
|
||||
// In new code, use unsafe.String or unsafe.StringData instead.
|
||||
// Deprecated: Use unsafe.String or unsafe.StringData instead.
|
||||
type StringHeader struct {
|
||||
Data uintptr
|
||||
Len int
|
||||
@@ -2756,7 +2756,7 @@ type StringHeader struct {
|
||||
// it references will not be garbage collected, so programs must keep
|
||||
// a separate, correctly typed pointer to the underlying data.
|
||||
//
|
||||
// In new code, use unsafe.Slice or unsafe.SliceData instead.
|
||||
// Deprecated: Use unsafe.Slice or unsafe.SliceData instead.
|
||||
type SliceHeader struct {
|
||||
Data uintptr
|
||||
Len int
|
||||
|
||||
Reference in New Issue
Block a user