False positive with dependent variables
jackwhelpton opened this issue · comments
Jack Whelpton commented
This appears similar to #4, but in this case the rewrite is far from obvious:
line := <-out
if got := line[strings.Index(line, " INFO")+1:]; got != want {
// Only validate the message: other tests cover timestamp
t.Fatalf("got %v, want %v", got, want)
}
as defining two dependent variables using multiple assignments is a challenge (barring refactoring the logic that produces "got" into a separate function, anonymous or otherwise).