module: use strings.ContainsRune in fileNameOK

As suggested by Ian for similar code on CL 326010.

Change-Id: I7c6ca4191481daf253eba5f12e7079f5c3522e88
Reviewed-on: https://go-review.googlesource.com/c/mod/+/327029
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/module/module.go b/module/module.go
index ba97ac3..89bd3ed 100644
--- a/module/module.go
+++ b/module/module.go
@@ -286,12 +286,7 @@
 		if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' {
 			return true
 		}
-		for i := 0; i < len(allowed); i++ {
-			if rune(allowed[i]) == r {
-				return true
-			}
-		}
-		return false
+		return strings.ContainsRune(allowed, r)
 	}
 	// It may be OK to add more ASCII punctuation here, but only carefully.
 	// For example Windows disallows < > \, and macOS disallows :, so we must not allow those.