ci: add reviewdog (#1096)
This commit is contained in:
@@ -105,13 +105,13 @@ func RawFieldNames(in interface{}, postgresSql ...bool) []string {
|
||||
fi := typ.Field(i)
|
||||
if tagv := fi.Tag.Get(dbTag); tagv != "" {
|
||||
if pg {
|
||||
out = append(out, fmt.Sprintf("%s", tagv))
|
||||
out = append(out, tagv)
|
||||
} else {
|
||||
out = append(out, fmt.Sprintf("`%s`", tagv))
|
||||
}
|
||||
} else {
|
||||
if pg {
|
||||
out = append(out, fmt.Sprintf("%s", fi.Name))
|
||||
out = append(out, fi.Name)
|
||||
} else {
|
||||
out = append(out, fmt.Sprintf("`%s`", fi.Name))
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package gen
|
||||
|
||||
import "regexp"
|
||||
|
||||
func (g *defaultGenerator) split(source string) []string {
|
||||
reg := regexp.MustCompile(createTableFlag)
|
||||
index := reg.FindAllStringIndex(source, -1)
|
||||
list := make([]string, 0)
|
||||
|
||||
for i := len(index) - 1; i >= 0; i-- {
|
||||
subIndex := index[i]
|
||||
if len(subIndex) == 0 {
|
||||
continue
|
||||
}
|
||||
start := subIndex[0]
|
||||
ddl := source[start:]
|
||||
list = append(list, ddl)
|
||||
source = source[:start]
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
@@ -14,16 +14,6 @@ import (
|
||||
// ErrNotFound is the alias of sql.ErrNoRows
|
||||
var ErrNotFound = sql.ErrNoRows
|
||||
|
||||
func desensitize(datasource string) string {
|
||||
// remove account
|
||||
pos := strings.LastIndex(datasource, "@")
|
||||
if 0 <= pos && pos+1 < len(datasource) {
|
||||
datasource = datasource[pos+1:]
|
||||
}
|
||||
|
||||
return datasource
|
||||
}
|
||||
|
||||
func escape(input string) string {
|
||||
var b strings.Builder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user