Skip to content

spec: the prose for the special case for append could be clearer #76226

@griesemer

Description

@griesemer

Follow-up on #76220:

Per the spec:

The variadic function append appends zero or more values x to a slice s of type S and returns the resulting slice, also of type S. The values x are passed to a parameter of type ...E where E is the element type of S and the respective parameter passing rules apply. As a special case, append also accepts a first argument assignable to type []byte with a second argument of string type followed by .... This form appends the bytes of the string.

Note that the special case prose doesn't necessarily imply that the first argument must be a slice. In particular, it could be nil because nil is assignable to []byte, yet that never was permitted in the implementation.

Should be more precise in prose.

Metadata

Metadata

Assignees

Labels

DocumentationIssues describing a change to documentation.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions