iperf3exporter/vendor/github.com/tdakkota/asciicheck/ascii.go
Marvin Preuss 2343c9588a
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
first commit
2021-10-20 10:08:56 +02:00

19 lines
272 B
Go

package asciicheck
import "unicode"
func isASCII(s string) (rune, bool) {
if len(s) == 1 {
return []rune(s)[0], s[0] <= unicode.MaxASCII
}
r := []rune(s)
for i := 0; i < len(s); i++ {
if r[i] > unicode.MaxASCII {
return r[i], false
}
}
return 0, true
}