I would like to echo on Tong Sun's suggestion here. I know his isn't an
"experience report" per se, but a suggestion worth building on, for those
who're wishful of optionals in Go.
The case mentioned might be immediately solvable by just using a pointer to
the variable, which gives you the abil
Other places where Go relies on every type having a zero value:
// Making slices with non-zero length.
s := make([]*int, 10)
// Reslicing a slice beyond its length.
s := make([]*int, 0, 10)[:10]
// Eliding fields from a composite literal.
p := struct { x: int; y: *int } {
What you are asking for is captured in https://golang.org/issue/7054
On Tuesday, August 22, 2017 at 12:28:41 PM UTC-7, Steven Blenkinsop wrote:
>
> Other places where Go relies on every type having a zero value:
>
> // Making slices with non-zero length.
> s := make([]*int, 10)
>
> //
Relevant Tweet: https://twitter.com/casio_juarez/status/900374362401914881
On Wednesday, August 23, 2017 at 1:42:07 AM UTC+5:30, Joe Tsai wrote:
>
> What you are asking for is captured in https://golang.org/issue/7054
>
> On Tuesday, August 22, 2017 at 12:28:41 PM UTC-7, Steven Blenkinsop wrote:
>