- Sort Score
- Num 10 results
- Language All
Results 1 - 5 of 5 for CutSuffix (0.06 seconds)
-
src/bytes/example_test.go
} func ExampleCutSuffix() { show := func(s, suffix string) { before, found := bytes.CutSuffix([]byte(s), []byte(suffix)) fmt.Printf("CutSuffix(%q, %q) = %q, %v\n", s, suffix, before, found) } show("Gopher", "Go") show("Gopher", "er") // Output: // CutSuffix("Gopher", "Go") = "Gopher", false // CutSuffix("Gopher", "er") = "Goph", true } func ExampleEqual() {
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Mon May 12 16:07:54 GMT 2025 - 16.5K bytes - Click Count (0) -
src/bytes/bytes.go
} return s[len(prefix):], true } // CutSuffix returns s without the provided ending suffix byte slice // and reports whether it found the suffix. // If s doesn't end with suffix, CutSuffix returns s, false. // If suffix is the empty byte slice, CutSuffix returns s, true. // // CutSuffix returns slices of the original slice s, not copies. func CutSuffix(s, suffix []byte) (before []byte, found bool) {
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Mar 12 17:56:55 GMT 2026 - 36.3K bytes - Click Count (0) -
cmd/sftp-server.go
user, found := strings.CutSuffix(c.User(), "=ldap") if found { if !globalIAMSys.LDAPConfig.Enabled() { return nil, errSFTPLDAPNotEnabled } return processLDAPAuthentication(key, pass, user) } user, found = strings.CutSuffix(c.User(), "=svc") if found { goto internalAuth } if globalIAMSys.LDAPConfig.Enabled() {
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 16.5K bytes - Click Count (0) -
src/bytes/bytes_test.go
{"", "d", "", false}, {"", "", "", true}, } func TestCutSuffix(t *testing.T) { for _, tt := range cutSuffixTests { if before, found := CutSuffix([]byte(tt.s), []byte(tt.sep)); string(before) != tt.before || found != tt.found { t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, before, found, tt.before, tt.found) } } } func TestBufferGrowNegative(t *testing.T) { defer func() {Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Wed Mar 11 03:07:05 GMT 2026 - 62.9K bytes - Click Count (0) -
src/archive/zip/reader.go
} rc, err := e.file.Open() if err != nil { return nil, err } return rc.(fs.File), nil } func split(name string) (dir, elem string, isDir bool) { name, isDir = strings.CutSuffix(name, "/") i := strings.LastIndexByte(name, '/') if i < 0 { return ".", name, isDir } return name[:i], name[i+1:], isDir } var dotFile = &fileListEntry{name: "./", isDir: true}
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Jan 15 18:35:56 GMT 2026 - 28.5K bytes - Click Count (0)