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:
- Simplify .NewGoMySQLReader() func in
go/binlog/gomysql_reader.go- Remove unused
errreturn
- Remove unused
- Use a type-based
switchfor binlog event type ingo/binlog/gomysql_reader.go- This simplifies a future PR for GTID support
- Use
switchon theCutOverTypefield to pick cutover logic
- contributed code is using same conventions as original code
-
script/cibuildreturns with no formatting errors, build errors or unit test errors