GoAdminGroup / go-admin

Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern
Major
18 occurrences in this check
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
302
303func addToTitle(chains DisplayProcessFnChains) DisplayProcessFnChains {
304	chains = chains.Add(func(value FieldModel) interface{} {
305		return strings.Title(value.Value)306	})
307	return chains
308}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
179
180func (f FieldDisplay) AddToTitle() DisplayProcessFnChains {
181	return f.DisplayProcessChains.Add(func(value FieldModel) interface{} {
182		return strings.Title(value.Value)183	})
184}
185
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
238		panic(err)
239	}
240
241	tempPlugin, err := plug.Lookup(strings.Title(name))242	if err != nil {
243		logger.Error("AddFromPlugin err", err)
244		panic(err)
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
466		}
467
468		fields[i] = Field{
469			Head:         strings.Title(model[fieldField].(string)),470			Name:         model[fieldField].(string),
471			DBType:       typeName,
472			CanAdd:       true,
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
435	r, _ := regexp.Compile(`\(.*?\)`)
436	typeName = r.ReplaceAllString(typeName, "")
437	r2, _ := regexp.Compile(`unsigned(.*)`)
438	return strings.TrimSpace(strings.Title(strings.ToLower(r2.ReplaceAllString(typeName, ""))))439}
440
441func getFieldsFromConn(conn db.Connection, table, driver string) Fields {
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
425		if i == 0 {
426			res += arr[i]
427		} else {
428			res += strings.Title(arr[i])429		}
430	}
431	return res
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
308		lowerTable := strings.ToLower(tables[i])
309		if !strings.Contains(tablesContent, `"`+lowerTable+`"`) {
310			tableStr += fmt.Sprintf(`
311	"%s": Get%sTable, `, lowerTable, strings.Title(camelcase(tables[i])))312
313			if commentStr != "" {
314				commentStr += `
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
178		cfg.Output = cfg.Output[:len(cfg.Output)-1]
179	}
180
181	tt := strings.Title(ta)182
183	detailFields := make(Fields, 0)
184	if len(fields) > 2 {
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
124	}
125
126	fields := getFieldsFromConn(cfg.Conn, dbTable, cfg.Driver)
127	tt := strings.Title(ta)128
129	pkey, ptype := fields.GetPrimaryKey()
130
"io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.
  4	"bytes"
  5	"fmt"
  6	"go/format"
  7	"io/ioutil"  8	"path/filepath"
  9	"regexp"
 10	"strings"
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1993	r, _ := regexp.Compile(`\(.*?\)`)
1994	typeName = r.ReplaceAllString(typeName, "")
1995	r2, _ := regexp.Compile(`unsigned(.*)`)
1996	return strings.TrimSpace(strings.Title(strings.ToLower(r2.ReplaceAllString(typeName, ""))))1997}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1982	}
1983	for _, t := range db.BoolTypeList {
1984		text := string(t)
1985		v := strings.Title(strings.ToLower(text))1986		opts[z] = types.FieldOption{Text: text, Value: v}
1987		z++
1988	}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1976	}
1977	for _, t := range db.UintTypeList {
1978		text := string(t)
1979		v := strings.Title(strings.ToLower(text))1980		opts[z] = types.FieldOption{Text: text, Value: v}
1981		z++
1982	}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1970	}
1971	for _, t := range db.FloatTypeList {
1972		text := string(t)
1973		v := strings.Title(strings.ToLower(text))1974		opts[z] = types.FieldOption{Text: text, Value: v}
1975		z++
1976	}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1964	}
1965	for _, t := range db.StringTypeList {
1966		text := string(t)
1967		v := strings.Title(strings.ToLower(text))1968		opts[z] = types.FieldOption{Text: text, Value: v}
1969		z++
1970	}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1958	z := 0
1959	for _, t := range db.IntTypeList {
1960		text := string(t)
1961		v := strings.Title(strings.ToLower(text))1962		opts[z] = types.FieldOption{Text: text, Value: v}
1963		z++
1964	}
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
1436				for i, model := range columnsModel {
1437					typeName := getType(model[typeField].(string))
1438
1439					headName[i] = strings.Title(model[fieldField].(string))1440					fieldName[i] = model[fieldField].(string)
1441					dbTypeList[i] = typeName
1442					formTypeList[i] = form.GetFormTypeFromFieldType(db.DT(strings.ToUpper(typeName)),
"io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.
 10	"errors"
 11	"fmt"
 12	"io"
 13	"io/ioutil" 14	"math"
 15	"net"
 16	"net/http"