Skip to content

Commit

Permalink
unsafe: remove incorrect type conversion in docs
Browse files Browse the repository at this point in the history
Fixes #17818.

Change-Id: Id7242b0bdd5e1db254b44ae29900fc4f3362c743
Reviewed-on: https://go-review.googlesource.com/32828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
ianlancetaylor committed Nov 7, 2016
1 parent f815499 commit 9d139ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unsafe/unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 9d139ac

Please sign in to comment.