diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-11-06 10:35:58 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-11-07 18:54:14 +0000 |
commit | 9d139ac3fa1f4c0c468042bdc6248a30044fb1bb (patch) | |
tree | 5f5b356667e09404c3baa6edb3eec568d3753fb1 | |
parent | f815499fab5f650f3eba12d48c53ec01d1362265 (diff) | |
download | go-9d139ac3fa1f4c0c468042bdc6248a30044fb1bb.tar.gz go-9d139ac3fa1f4c0c468042bdc6248a30044fb1bb.zip |
unsafe: remove incorrect type conversion in docs
Fixes #17818.
Change-Id: Id7242b0bdd5e1db254b44ae29900fc4f3362c743
Reviewed-on: https://go-review.googlesource.com/32828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/unsafe/unsafe.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/unsafe/unsafe.go b/src/unsafe/unsafe.go index 0b59ff204b..859ca4fa3b 100644 --- a/src/unsafe/unsafe.go +++ b/src/unsafe/unsafe.go @@ -155,7 +155,7 @@ type ArbitraryType int // var s string // hdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) // case 1 // hdr.Data = uintptr(unsafe.Pointer(p)) // case 6 (this case) -// hdr.Len = uintptr(n) +// hdr.Len = n // // In this usage hdr.Data is really an alternate way to refer to the underlying // pointer in the slice header, not a uintptr variable itself. @@ -168,7 +168,7 @@ type ArbitraryType int // // INVALID: a directly-declared header will not hold Data as a reference. // var hdr reflect.StringHeader // hdr.Data = uintptr(unsafe.Pointer(p)) -// hdr.Len = uintptr(n) +// hdr.Len = n // s := *(*string)(unsafe.Pointer(&hdr)) // p possibly already lost // type Pointer *ArbitraryType |