diff --git a/baselib.go b/baselib.go index aa2c08a9..7572d696 100644 --- a/baselib.go +++ b/baselib.go @@ -410,7 +410,7 @@ func baseToNumber(L *LState) int { L.Push(lv) case LString: str := strings.Trim(string(lv), " \n\t") - if strings.Index(str, ".") > -1 { + if strings.ContainsRune(str, '.') { if v, err := strconv.ParseFloat(str, LNumberBit); err != nil { L.Push(LNil) } else { diff --git a/parse/lexer.go b/parse/lexer.go index c20a0bdd..0f1cae47 100644 --- a/parse/lexer.go +++ b/parse/lexer.go @@ -512,7 +512,7 @@ func dump(node interface{}, level int, s string) string { tt := rt.Elem() indicies := []int{} for i := 0; i < tt.NumField(); i++ { - if strings.Index(tt.Field(i).Name, "Base") > -1 { + if strings.Contains(tt.Field(i).Name, "Base") { continue } indicies = append(indicies, i)