Enable gosimple and ineffasign linters

This commit is contained in:
Andrey Smirnov
2017-04-27 18:34:30 +03:00
parent 7a7b981d4f
commit bae3f949b4
16 changed files with 32 additions and 49 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ func (q *FieldQuery) Fast(list PackageCatalog) bool {
// String interface
func (q *FieldQuery) String() string {
escape := func(val string) string {
if strings.IndexAny(val, "()|,!{} \t\n") != -1 {
if strings.ContainsAny(val, "()|,!{} \t\n") {
return "'" + strings.Replace(strings.Replace(val, "\\", "\\\\", -1), "'", "\\'", -1) + "'"
}
return val