Equivalent binary trees (A Tour of Go)
This is a nice answer to a fun challenge.  There are a couple ways I can see to improve it.


This solution only works for arrays of up to 10 values due to the for loop terminating after 10 iterations.  We can make it work for an arbitrary number of values by closeing the channel when Walk has complete, and testing for each channel's state to match.
Testing the value earlier in the walk will lead to earlier fails.  Reordering the send on the channel to be first will allow this.


Here is a refactored version of your code:

func Walk(t *tree.Tree, vals chan int) {
    if t != nil {
        vals &lt;- t.Value
        Walk(t.Left, vals)
        Walk(t.Right, vals)
    }
}

func Same(a, b *tree.Tree) bool {
    avals := make(chan int, 8)
    bvals := make(chan int, 8)
    go func() {
        Walk(a, avals)
        close(avals)
    }()
    go func() {
        Walk(b, bvals)
        close(bvals)
    }()
    for {
        av, aopen := &lt;-avals
        bv, bopen := &lt;-bvals
        if aopen != bopen || av != bv {
            return false
        }
        if !aopen {
            return true
        }
    }
}


Buffering the channels is still useful since synchronization is not a requirement for evaulation, so I've left them buffered.