Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for CutSuffix (0.07 sec)

  1. src/bytes/example_test.go

    }
    
    func ExampleCutSuffix() {
    	show := func(s, sep string) {
    		before, found := bytes.CutSuffix([]byte(s), []byte(sep))
    		fmt.Printf("CutSuffix(%q, %q) = %q, %v\n", s, sep, before, found)
    	}
    	show("Gopher", "Go")
    	show("Gopher", "er")
    	// Output:
    	// CutSuffix("Gopher", "Go") = "Gopher", false
    	// CutSuffix("Gopher", "er") = "Goph", true
    }
    
    func ExampleEqual() {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  2. 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() {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 20 20:00:29 UTC 2024
    - 16K bytes
    - Viewed (0)
  3. 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) {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  4. 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}
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Sat Aug 03 01:05:29 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  5. 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() {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
  6. api/go1.20.txt

    pkg archive/tar, var ErrInsecurePath error #55356
    pkg archive/zip, var ErrInsecurePath error #55356
    pkg bytes, func Clone([]uint8) []uint8 #45038
    pkg bytes, func CutPrefix([]uint8, []uint8) ([]uint8, bool) #42537
    pkg bytes, func CutSuffix([]uint8, []uint8) ([]uint8, bool) #42537
    pkg context, func Cause(Context) error #51365
    pkg context, func WithCancelCause(Context) (Context, CancelCauseFunc) #51365
    pkg context, type CancelCauseFunc func(error) #51365
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Feb 17 21:23:32 UTC 2023
    - 602.6K bytes
    - Viewed (0)
Back to top