Help us shape the future of Go! Take the 2026 Go Developer Survey

conf

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 4 Imported by: 0

README

GORM Conf

提供GORM常用配置

快速上手

package main

import(
  "github.com/jinzhu/gorm"
  conf "github.com/surh-go/gorm_conf"

  //
  _ "github.com/jinzhu/gorm/dialects/mysql"
)

func main() {
  db, err := gorm.Open("mysql", connString)
  // Error
  if err != nil {
    util.Log().Panic("连接数据库不成功", err)
  }
  conf.Conf(&db)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conf

func Conf(db *gorm.DB)

Conf 配置数据库连接

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL