Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for Cut (0.12 sec)

  1. src/bytes/example_test.go

    		before, after, found := bytes.Cut([]byte(s), []byte(sep))
    		fmt.Printf("Cut(%q, %q) = %q, %q, %v\n", s, sep, before, after, found)
    	}
    	show("Gopher", "Go")
    	show("Gopher", "ph")
    	show("Gopher", "er")
    	show("Gopher", "Badger")
    	// Output:
    	// Cut("Gopher", "Go") = "", "pher", true
    	// Cut("Gopher", "ph") = "Go", "er", true
    	// Cut("Gopher", "er") = "Goph", "", true
    	// Cut("Gopher", "Badger") = "Gopher", "", 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)
  2. src/archive/tar/strconv.go

    func parsePAXTime(s string) (time.Time, error) {
    	const maxNanoSecondDigits = 9
    
    	// Split string into seconds and sub-seconds parts.
    	ss, sn, _ := strings.Cut(s, ".")
    
    	// Parse the seconds.
    	secs, err := strconv.ParseInt(ss, 10, 64)
    	if err != nil {
    		return time.Time{}, ErrHeader
    	}
    	if len(sn) == 0 {
    		return time.Unix(secs, 0), nil // No sub-second values
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 01 14:28:42 GMT 2023
    - 9K bytes
    - Viewed (0)
  3. misc/linkcheck/linkcheck.go

    func crawl(url string, sourceURL string) {
    	if strings.Contains(url, "/devel/release") {
    		return
    	}
    	mu.Lock()
    	defer mu.Unlock()
    	if u, frag, ok := strings.Cut(url, "#"); ok {
    		url = u
    		if frag != "" {
    			uf := urlFrag{url, frag}
    			neededFrags[uf] = append(neededFrags[uf], sourceURL)
    		}
    	}
    	if crawled[url] {
    		return
    	}
    	crawled[url] = true
    
    	wg.Add(1)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Oct 06 15:53:04 GMT 2021
    - 3.9K bytes
    - Viewed (0)
  4. src/bytes/bytes.go

    			}
    			return i + j
    		}
    	}
    	return -1
    }
    
    // Cut slices s around the first instance of sep,
    // returning the text before and after sep.
    // The found result reports whether sep appears in s.
    // If sep does not appear in s, cut returns s, nil, false.
    //
    // Cut returns slices of the original slice s, not copies.
    func Cut(s, sep []byte) (before, after []byte, found bool) {
    	if i := Index(s, sep); i >= 0 {
    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)
  5. api/go1.18.txt

    pkg bufio, method (*Writer) AvailableBuffer() []uint8
    pkg bufio, method (ReadWriter) AvailableBuffer() []uint8
    pkg bytes, func Cut([]uint8, []uint8) ([]uint8, []uint8, bool)
    pkg bytes, func Title //deprecated
    pkg crypto/tls, method (*Conn) NetConn() net.Conn
    pkg crypto/tls, type Config struct, PreferServerCipherSuites //deprecated
    pkg crypto/x509, method (*CertPool) Subjects //deprecated
    pkg debug/buildinfo, func Read(io.ReaderAt) (*debug.BuildInfo, error)
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Fri Feb 17 20:31:46 GMT 2023
    - 13K bytes
    - Viewed (0)
  6. misc/ios/go_ios_exec.go

    	teamID = getenv("GOIOS_TEAM_ID")
    
    	// Device IDs as listed with ios-deploy -c.
    	deviceID = os.Getenv("GOIOS_DEVICE_ID")
    
    	if _, id, ok := strings.Cut(appID, "."); ok {
    		bundleID = id
    	}
    
    	if err := signApp(appdir); err != nil {
    		return err
    	}
    
    	if err := uninstallDevice(bundleID); err != nil {
    		return err
    	}
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Apr 11 16:34:30 GMT 2022
    - 23.4K bytes
    - Viewed (0)
  7. src/bytes/bytes_test.go

    	{"", "d", "", "", false},
    	{"", "", "", "", true},
    }
    
    func TestCut(t *testing.T) {
    	for _, tt := range cutTests {
    		if before, after, found := Cut([]byte(tt.s), []byte(tt.sep)); string(before) != tt.before || string(after) != tt.after || found != tt.found {
    			t.Errorf("Cut(%q, %q) = %q, %q, %v, want %q, %q, %v", tt.s, tt.sep, before, after, found, tt.before, tt.after, tt.found)
    		}
    	}
    }
    
    var cutPrefixTests = []struct {
    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)
  8. src/cmd/api/main_test.go

    	var nonblank []string
    	for i, line := range lines {
    		line = strings.TrimSpace(line)
    		if line == "" || strings.HasPrefix(line, "#") {
    			continue
    		}
    		if needApproval {
    			feature, approval, ok := strings.Cut(line, "#")
    			if !ok {
    				log.Printf("%s:%d: missing proposal approval\n", filename, i+1)
    				exitCode = 1
    			} else {
    				_, err := strconv.Atoi(approval)
    				if err != nil {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  9. src/archive/tar/writer_test.go

    		}
    
    		// The prefix field should never appear in the GNU format.
    		var blk block
    		copy(blk[:], b.Bytes())
    		prefix := string(blk.toUSTAR().prefix())
    		prefix, _, _ = strings.Cut(prefix, "\x00") // Truncate at the NUL terminator
    		if blk.getFormat() == FormatGNU && len(prefix) > 0 && strings.HasPrefix(name, prefix) {
    			t.Errorf("test %d, found prefix in GNU format: %s", i, prefix)
    		}
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
Back to top