Will there be a memory leak when writing golang code like this?

package parts

import (
    "Qmoser/linstream_identity_servter/src/config"
    "fmt"

    "github.com/go-redis/redis"

    _ "github.com/go-sql-driver/mysql"
    "github.com/go-xorm/xorm"
    mgo "gopkg.in/mgo.v2"
)

type loading interface {
    Loading_mongdb()
    Close_mongdb()
    Loading_mysql()
    Close_mysql()
    Loading_redis()
    Close_redis()
}

type MMR struct {
    Mongdb_conn *mgo.Session
    Mysql_conn  *xorm.Engine
    Redis_conn  *redis.Client
    loading
}

func (self *MMR) Loading_mongdb() {
    mongdb_conn_str := config.Global_Config.Get("mongdb_conn")

    session, err := mgo.Dial(mongdb_conn_str)
    if err != nil {
        panic(err)
    } else {
        self.Mongdb_conn = session
    }
    // defer session.Close()

    // Optional. Switch the session to a monotonic behavior.
    session.SetMode(mgo.Monotonic, true)
}

func (self *MMR) Close_mongdb() {
    if self.Mongdb_conn != nil {
        self.Mongdb_conn.Close()
    }
}

func (self *MMR) Loading_mysql() {
    var err error
    mysql_conn := config.Global_Config.Get("mysql_conn")
    self.Mysql_conn, err = xorm.NewEngine("mysql", mysql_conn)
    if err != nil {
        panic("mysql " + err.Error())
    }

    fmt.Println("***************************************")
    fmt.Println(self.Mysql_conn)
    fmt.Println("***************************************")

}

func (self *MMR) Close_mysql() {
    if self.Mysql_conn != nil {
        self.Mysql_conn.Close()
    }
}

func (self *MMR) Loading_redis() {

    redis_ip, redis_port, redis_pwd, redis_db :=
        config.Global_Config.Get("redis_ip"),
        config.Global_Config.Get("redis_port"),
        config.Global_Config.Get("redis_pwd"),
        config.Global_Config.GetInt("redis_pwd")

    // use default DB
    redis_ip_port := redis_ip + `:` + redis_port
    self.Redis_conn = redis.NewClient(&redis.Options{Addr: redis_ip_port, Password: redis_pwd, DB: redis_db})

    if _, err := self.Redis_conn.Ping().Result(); err != nil {
        panic("Redis " + err.Error())
    }
}

func (self *MMR) Close_redis() {
    if self.Redis_conn != nil {
        self.Redis_conn.Close()
    }
}

var GParts *MMR

func init() {
    GParts = new(MMR)
    // GParts.Loading_mongdb()
    GParts.Loading_mysql()

    fmt.Println("***************************************")
    fmt.Println(GParts.Mysql_conn)
    fmt.Println("***************************************")

    // GParts.Loading_redis()
}

external code calls GParts directly

Mar.20,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32c95-2be4b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32c95-2be4b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?