mirror of
https://github.com/beego/bee.git
synced 2025-06-27 15:50:19 +00:00
add ineffassign check
This commit is contained in:
@ -503,9 +503,7 @@ func (mysqlDB *MysqlDB) GetColumns(db *sql.DB, table *Table, blackList map[strin
|
||||
|
||||
// GetGoDataType maps an SQL data type to Golang data type
|
||||
func (*MysqlDB) GetGoDataType(sqlType string) (string, error) {
|
||||
var typeMapping = map[string]string{}
|
||||
typeMapping = typeMappingMysql
|
||||
if v, ok := typeMapping[sqlType]; ok {
|
||||
if v, ok := typeMappingMysql[sqlType]; ok {
|
||||
return v, nil
|
||||
}
|
||||
return "", fmt.Errorf("data type '%s' not found", sqlType)
|
||||
@ -766,7 +764,7 @@ func writeModelFiles(tables []*Table, mPath string, selectedTables map[string]bo
|
||||
continue
|
||||
}
|
||||
}
|
||||
template := ""
|
||||
var template string
|
||||
if tb.Pk == "" {
|
||||
template = StructModelTPL
|
||||
} else {
|
||||
|
@ -369,7 +369,7 @@ func writeHproseModelFiles(tables []*Table, mPath string, selectedTables map[str
|
||||
continue
|
||||
}
|
||||
}
|
||||
template := ""
|
||||
var template string
|
||||
if tb.Pk == "" {
|
||||
template = HproseStructModelTPL
|
||||
} else {
|
||||
|
@ -216,7 +216,7 @@ func GenerateDocs(curpath string) {
|
||||
for _, p := range params {
|
||||
switch pp := p.(type) {
|
||||
case *ast.CallExpr:
|
||||
controllerName := ""
|
||||
var controllerName string
|
||||
if selname := pp.Fun.(*ast.SelectorExpr).Sel.String(); selname == "NSNamespace" {
|
||||
s, params := analyseNewNamespace(pp)
|
||||
for _, sp := range params {
|
||||
@ -298,12 +298,10 @@ func analyseNSInclude(baseurl string, ce *ast.CallExpr) string {
|
||||
}
|
||||
if apis, ok := controllerList[cname]; ok {
|
||||
for rt, item := range apis {
|
||||
tag := ""
|
||||
tag := cname
|
||||
if baseurl != "" {
|
||||
rt = baseurl + rt
|
||||
tag = strings.Trim(baseurl, "/")
|
||||
} else {
|
||||
tag = cname
|
||||
}
|
||||
if item.Get != nil {
|
||||
item.Get.Tags = []string{tag}
|
||||
@ -749,7 +747,6 @@ func parseObject(d *ast.Object, k string, m *swagger.Schema, realTypes *[]string
|
||||
if st.Fields.List != nil {
|
||||
m.Properties = make(map[string]swagger.Propertie)
|
||||
for _, field := range st.Fields.List {
|
||||
realType := ""
|
||||
isSlice, realType, sType := typeAnalyser(field)
|
||||
if (isSlice && isBasicType(realType)) || sType == "object" {
|
||||
if len(strings.Split(realType, " ")) > 1 {
|
||||
|
Reference in New Issue
Block a user