Because then you could do this:
func PrintAll(vals []interface{}) {
vals[0] = 123
}
func main() {
names := []string{"stanley", "david", "oscar"}
var s string
s = names[0]
}
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsu
color := colorFor(temperature)
func colorFor(temperature int) string {
if temperature > 100 {
return "red"
}
return "blue"
}
On Thursday, 16 August 2018 18:01:20 UTC+2, Haddock wrote:
>
>
> var color
>> if temperature > 100 {
>> color = “red”
>> } else {
>> color = “blue”
>> }
>>
>
The announcement in April said:
What’s happening next
>
> The website will be getting a refresh based on the new design. Since we
> are making significant changes, we are also taking this opportunity to
> update our website infrastructure to better serve our global community with
> internati
I prefer seeing the contract by example over having a combination of two
dozens of interface names like Eq, Lesser, Adder, Muler, Convertible(x),
Ranger, Lener, Caper, ... that have to be mentally mapped to their actual
syntactic representation. This smells like taxonomy ("the lowest form of
ac
The original, rejected proposal was better because it was a built-in, not a
new keyword, so it didn't break existing tools. Otherwise I don't see a
difference.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and s
1 go.{mod|sum} per repository, no vendoring
tree/
angular-ui/
cmd/
hello-api-server/
hello-cli/
hello-daemon/
internal/
internal-lib1/
internal-lib2/
library1/
library2/
library3/
python-tests/
go.mod
go.sum
On Saturday, 29 February 2020 19:03:34 UTC+1, Sankar wrote:
>
Why not put type parameters on packages?
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-put-type-parameters-on-packages
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this
On Thursday, 25 June 2020 06:17:24 UTC+2, Andrey T. wrote:
> 3. Ability to use decorated interface name as spec for type constrains
>
>func (type T Comparable) Max(a... T) (result T) {...}
>
>might become
>
>func Max(a... $Comparable) (result $Comparable) {...}
>
I don't see how th