You can do something like this if you want
package main import "fmt" type Pair struct { a, b interface{} } func main() { p1 := Pair{"finished", 42} p2 := Pair{6.1, "hello"} fmt.Println("p1=", p1, "p2=", p2) fmt.Println("p1.b", p1.b)
However, I think that you are already completely idiomatic, and the structure perfectly describes your data, which is a big advantage compared to using simple tuples.
Nick Craig-Wood Dec 02 '12 at 16:15 2012-12-02 16:15
source share