Browse Source

Use interpolateParams option of MySQL driver

INADA Naoki 9 years ago
parent
commit
3fad3d06ef
1 changed files with 2 additions and 5 deletions
  1. 2 5
      frameworks/Go/beego/src/hello/hello.go

+ 2 - 5
frameworks/Go/beego/src/hello/hello.go

@@ -3,16 +3,15 @@ package main
 import (
 	"log"
 	"math/rand"
+
 	"github.com/astaxie/beego"
 	"github.com/astaxie/beego/orm"
-
 	_ "github.com/go-sql-driver/mysql"
-	//"runtime"
 )
 
 const (
 	// Database
-	connectionString   = "benchmarkdbuser:benchmarkdbpass@tcp(localhost:3306)/hello_world"
+	connectionString   = "benchmarkdbuser:benchmarkdbpass@tcp(localhost:3306)/hello_world?collation=utf8mb4_bin&interpolateParams=true"
 	worldRowCount      = 10000
 	macIdleConnection  = 30
 	maxConnectionCount = 256
@@ -68,8 +67,6 @@ func (this *DBController) Get() {
 }
 
 func main() {
-	//don't need this set, beego default set it
-	//runtime.GOMAXPROCS(runtime.NumCPU())
 	beego.BConfig.RunMode = "prod"
 	beego.Router("/json", &JsonController{})
 	beego.Router("/db", &DBController{})