TIL: You can stop Go from auto-removing unused imports when saving a file by adding an underscore before the import line, e.g.
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
This is necessary because database/sql relies on go-sql-driver/mysql (it needs a driver in order to work) but as you never call a mysql.* function Go thinks you're not using that import and removes it.