1
0
mirror of https://github.com/golang/go synced 2024-11-06 22:46:14 -07:00
Commit Graph

7 Commits

Author SHA1 Message Date
Rob Pike
37db664c6c builtin: document when len and cap are constant
The rules are subtle, but under some circumstances the result
can be constant. Mention this and refer to the appropriate
section of the specification.

Fixes #27588.

Change-Id: I4beaad036db87501378fb2ef48d216742d096933
Reviewed-on: https://go-review.googlesource.com/135519
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-09-18 21:52:11 +00:00
Ian Lance Taylor
ce68e1b81c builtin: improve docs for make slice
Fixes #22764

Change-Id: I339d3bbb08983e0d69d69a1d00c4d15d0661762a
Reviewed-on: https://go-review.googlesource.com/78335
Reviewed-by: Rob Pike <r@golang.org>
2017-11-18 01:48:52 +00:00
Brad Fitzpatrick
703a9baf5c builtin: use type aliases for rune and byte
As motivated by https://golang.org/design/18130-type-alias which says:

https://github.com/golang/proposal/blob/master/design/18130-type-alias.md#relationship-to-byte-and-rune

> The language specification already defines byte as an alias for
> uint8 and similarly rune as an alias for int32, using the word alias
> as an informal term. It is a goal that the new type declaration
> semantics not introduce a different meaning for alias. That is, it
> should be possible to describe the existing meanings of byte and
> uint8 by saying that they behave as if predefined by:
>
>     type byte = uint8
>     type rune = int32

So, do that. Seems to work.

Updates #18130

Change-Id: I0740bab3f8fb23e946f3542fdbe819007a99465a
Reviewed-on: https://go-review.googlesource.com/45017
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-07 00:42:59 +00:00
Brad Fitzpatrick
1fcd7861e3 builtin: fix signature of the builtin function make
Fixes #20325

Change-Id: Ie363fef73d0deae40af41ee3f4403ad18546eba6
Reviewed-on: https://go-review.googlesource.com/43460
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-05-13 16:16:48 +00:00
Ian Lance Taylor
ca993d6797 builtin: clarify that make(map[K]V, n) allocates space for n elements
Change-Id: Id6265b6093edaa4be2c59e4799351082f7228b5d
Reviewed-on: https://go-review.googlesource.com/28815
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-09-10 12:57:37 +00:00
Brad Fitzpatrick
d0ed87d15c builtin: remove errant space in hyphenated adjective phrase
Change-Id: I67947e0e3189093e830120941ee49f9f32086f0e
Reviewed-on: https://go-review.googlesource.com/11615
Reviewed-by: Rob Pike <r@golang.org>
2015-06-28 21:41:38 +00:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
2014-09-08 00:08:51 -04:00