- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for ContainsRune (0.25 sec)
-
src/bytes/bytes.go
func (as *asciiSet) contains(c byte) bool { return (as[c/32] & (1 << (c % 32))) != 0 } // containsRune is a simplified version of strings.ContainsRune // to avoid importing the strings package. // We avoid bytes.ContainsRune to avoid allocating a temporary copy of s. func containsRune(s string, r rune) bool { for _, c := range s { if c == r { return true } } return false }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Feb 19 19:51:15 GMT 2024 - 33.8K bytes - Viewed (0) -
src/bytes/example_test.go
// true // false // false } func ExampleContainsRune() { fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'f')) fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'ö')) fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '大')) fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '!')) fmt.Println(bytes.ContainsRune([]byte(""), '@')) // Output: // true // false // true // true // false
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Mar 04 15:54:40 GMT 2024 - 15K bytes - Viewed (1) -
internal/handlers/proxy.go
return raddr } // GetSourceIP retrieves the IP from the request headers // and falls back to r.RemoteAddr when necessary. func GetSourceIP(r *http.Request) string { addr := GetSourceIPRaw(r) if strings.ContainsRune(addr, ':') { return "[" + addr + "]" } return addr
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri Dec 22 00:56:55 GMT 2023 - 5.1K bytes - Viewed (0) -
chainable_api.go
return } // Omit specify fields that you want to ignore when creating, updating and querying func (db *DB) Omit(columns ...string) (tx *DB) { tx = db.getInstance() if len(columns) == 1 && strings.ContainsRune(columns[0], ',') { tx.Statement.Omits = strings.FieldsFunc(columns[0], utils.IsValidDBNameChar) } else { tx.Statement.Omits = columns } return } // Where add conditions //
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
internal/etag/etag.go
// It contains the encrypted ETag value + an authentication // code generated by the AEAD cipher. // // Here is an incorrect implementation of IsEncrypted: // // return len(e) > 16 && !bytes.ContainsRune(e, '-') // // An encrypted ETag may contain some random bytes - e.g. // and nonce value. This nonce value may contain a '-' // just by its nature of being randomly generated.
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Sun Mar 10 21:09:36 GMT 2024 - 13.3K bytes - Viewed (0) -
cmd/object-api-utils.go
} // This is valid for AWS S3 but it will never // work with file systems, we will reject here // to return object name invalid rather than // a cryptic error from the file system. return !strings.ContainsRune(object, 0) } // checkObjectNameForLengthAndSlash -check for the validity of object name length and prefis as slash func checkObjectNameForLengthAndSlash(bucket, object string) error {
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Mar 11 11:55:34 GMT 2024 - 35.6K bytes - Viewed (1) -
src/bytes/bytes_test.go
{[]byte("a☺b☻c☹d"), '☻', true}, {[]byte("aRegExp*"), '*', true}, } func TestContainsRune(t *testing.T) { for _, ct := range ContainsRuneTests { if ContainsRune(ct.b, ct.r) != ct.expected { t.Errorf("ContainsRune(%q, %q) = %v, want %v", ct.b, ct.r, !ct.expected, ct.expected) } } } func TestContainsFunc(t *testing.T) { for _, ct := range ContainsRuneTests {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Jan 24 16:07:25 GMT 2024 - 56.2K bytes - Viewed (0)