Learning Functional Programming in Go
上QQ阅读APP看书,第一时间看更新

Join example

The following code shows an example of the Join() function:

 // left collection:
0001, "alice", "bob"
0001, "cindy", "dan"
0002, "evelyn", "frank"
// right collection:
0001, "greg", "izzy"
0002, "jenny", "alice"

left.Join(right)

The output is as follows:

 0001, "alice", "bob", "greg", "izzy"
0001, "cindy", "dan", "greg", "izzy"
0002, "evelyn", "frank", "jenny", "alice"