I need a queue of (string
, int
) pairs. That's easy enough:
type job struct {
url string
depth int
}
queue := make(chan job)
queue <- job{url, depth}
are there built-in pair/tuple data types in Go? There is support for returning multiple values from a function, but as far as I can tell, the multiple value tuples produced are not first-class citizens in Go's type system. Is that the case?
As for the "what have you tried" part, the obvious syntax (from a Python programmer's POV)
queue := make(chan (string, int))
didn't work.