Skip to content

Testing equality of function with two return values #1683

Answered by brackendawson
pwaring asked this question in Q&A
Discussion options

You must be logged in to vote

The idiomatic way to implement this in Go is this:

leftExpected := []int{}
rightExpected := []int{}
left, right := getUnsortedPairs("")
assert.Equal(t, leftExpected, left)
assert.Equal(t, rightExpected, right)

This is tightly coupled.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brackendawson
Comment options

Answer selected by pwaring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants