goflyway
goflyway copied to clipboard
proxy: fix case order in a type switch
Type switch executes its clauses sequentially until the first match.
The *tcpmux.Stream
type implements net.Conn
, so if net.Conn
goes
before *tcpmux.Stream
case, it will catch *tcpmux.Stream
values and will
never let case
*tcpmux.Stream` to execute. The solution is simple, move
specific type case before the interface it implements.
Found using gocritic linter, caseOrder
checker.