Skip to content

spec: documentation of len() in string type unclear #28736

Closed
@fabulousduck

Description

@fabulousduck

The length of a string <code>s</code> (its size in bytes) can be discovered using

The documentation on how specifically len() can be used to determine the size of a string type in bytes can be confusing as this would make you expect that len("go") would return 16 (like unsafe.Sizeof("go") would) but actually gives you 2

I would like to ask for a better phrasing of how to use len() on string type in the docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions