Skip to content

Commit

Permalink
int64, method rm *
Browse files Browse the repository at this point in the history
  • Loading branch information
fizzday committed Dec 5, 2019
1 parent 0aeaa96 commit 48ebec5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions table2struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import (

//map for converting mysql type to golang types
var typeForMysqlToGo = map[string]string{
"int": "int",
"integer": "int",
"tinyint": "int",
"smallint": "int",
"mediumint": "int",
"int": "int64",
"integer": "int64",
"tinyint": "int64",
"smallint": "int64",
"mediumint": "int64",
"bigint": "int64",
"int unsigned": "int",
"integer unsigned": "int",
"tinyint unsigned": "int",
"smallint unsigned": "int",
"mediumint unsigned": "int",
"int unsigned": "int64",
"integer unsigned": "int64",
"tinyint unsigned": "int64",
"smallint unsigned": "int64",
"mediumint unsigned": "int64",
"bigint unsigned": "int64",
"bit": "int",
"bit": "int64",
"bool": "bool",
"enum": "string",
"set": "string",
Expand Down Expand Up @@ -189,7 +189,7 @@ func (t *Table2Struct) Run() error {

// 添加 method 获取真实表名
if t.realNameMethod != "" {
structContent += fmt.Sprintf("func (*%s) %s() string {\n",
structContent += fmt.Sprintf("func (%s) %s() string {\n",
structName, t.realNameMethod)
structContent += fmt.Sprintf("%sreturn \"%s\"\n",
tab(depth), tableRealName)
Expand Down

0 comments on commit 48ebec5

Please sign in to comment.