checkers.go 343 B

1234567891011121314151617
  1. package main
  2. import (
  3. "strings"
  4. "unicode/utf8"
  5. )
  6. // http://かhttps://で始まるかどうか
  7. func checkprefix (url string) bool {
  8. return strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")
  9. }
  10. // URLは500文字以内かどうか
  11. func checkcharlim (url string) bool {
  12. return utf8.RuneCountInString(url) <= 500
  13. }