Use `switch` statements for readability, simplify `.NewGoMySQLReader()` by timvaillancourt · Pull Request #1135 · github/gh-ost

Description

This PR moves 2 x blocks of code to use switch statements for a bit more clarity, as suggested by the gocritic linter. Also the .NewGoMySQLReader() func of go/binlog/gomysql_reader.go was simplified (unused err removed, etc)

This change should result in the exact same behaviour as before

Details:

  1. Simplify .NewGoMySQLReader() func in go/binlog/gomysql_reader.go
    • Remove unused err return
  2. Use a type-based switch for binlog event type in go/binlog/gomysql_reader.go
    • This simplifies a future PR for GTID support
  3. Use switch on the CutOverType field to pick cutover logic
  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors