I am using golang-migrate to migrate schema. Connection open, migration up and down are working fine. However, db connection is not getting closed, not throwing any error and leave idle connection in database server. My code looks like this:
m, err := migrate.New(sourceURL, "database_connection_string")
defer m.Close()
m.Version()
Has anyone faced similar issue ? How can we address this ?