Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckToLowerToUpperComparison / CheckToLowerToUpperComparison.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckToLowerToUpperComparison/CheckToLowerToUpperComparison.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckToLowerToUpperComparison/CheckToLowerToUpperComparison.go
new file mode 100644 (file)
index 0000000..40f1258
--- /dev/null
@@ -0,0 +1,43 @@
+package pkg
+
+import "strings"
+
+func fn() {
+       const (
+               s1 = "foo"
+               s2 = "bar"
+       )
+
+       if strings.ToLower(s1) == strings.ToLower(s2) { // want `should use strings\.EqualFold instead`
+               panic("")
+       }
+
+       if strings.ToUpper(s1) == strings.ToUpper(s2) { // want `should use strings\.EqualFold instead`
+               panic("")
+       }
+
+       if strings.ToLower(s1) != strings.ToLower(s2) { // want `should use strings\.EqualFold instead`
+               panic("")
+       }
+
+       switch strings.ToLower(s1) == strings.ToLower(s2) { // want `should use strings\.EqualFold instead`
+       case true, false:
+               panic("")
+       }
+
+       if strings.ToLower(s1) == strings.ToLower(s2) || s1+s2 == s2+s1 { // want `should use strings\.EqualFold instead`
+               panic("")
+       }
+
+       if strings.ToLower(s1) > strings.ToLower(s2) {
+               panic("")
+       }
+
+       if strings.ToLower(s1) < strings.ToLower(s2) {
+               panic("")
+       }
+
+       if strings.ToLower(s1) == strings.ToUpper(s2) {
+               panic("")
+       }
+}