Skip to content

Incomplete documentation for unsafe.Pointer #1433

Closed
@gopherbot

Description

@gopherbot

by spoon.reloaded:

The documentation for unsafe.Pointer from the Packages pages
(http://golang.org/pkg/unsafe/#Pointer) says that the following special operations can
be done on it:
1) A pointer value of any type can be converted to a Pointer.
2) A uintptr can be converted to a Pointer.
3) A Pointer can be converted to a uintptr.

However, the Go language specification
(http://golang.org/doc/go_spec.html#Package_unsafe) says that:
Any pointer or value of type uintptr can be converted into a Pointer and vice versa.

So the documentation above is missing the case:
4) A Pointer can be converted to a pointer value of any type

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions