Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for HasPrefix (0.25 sec)

  1. src/bytes/example_test.go

    	// Output: Fields are: ["foo1" "bar2" "baz3"]
    }
    
    func ExampleHasPrefix() {
    	fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("Go")))
    	fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("C")))
    	fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("")))
    	// Output:
    	// true
    	// false
    	// true
    }
    
    func ExampleHasSuffix() {
    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/cmd/cgo/ast.go

    func (f *File) saveExport(x interface{}, context astContext) {
    	n, ok := x.(*ast.FuncDecl)
    	if !ok {
    		return
    	}
    
    	if n.Doc == nil {
    		return
    	}
    	for _, c := range n.Doc.List {
    		if !strings.HasPrefix(c.Text, "//export ") {
    			continue
    		}
    
    		name := strings.TrimSpace(c.Text[9:])
    		if name == "" {
    			error_(c.Pos(), "export missing name")
    		}
    
    		if name != n.Name.Name {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jun 07 16:54:27 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  3. src/cmd/asm/internal/asm/operand_test.go

    					!strings.Contains(test.input, "<>")
    
    				wantName := ""
    				if isFuncSym {
    					// Strip $|* and (SB) and +Int.
    					wantName = test.output[:len(test.output)-4]
    					if strings.HasPrefix(wantName, "$") || strings.HasPrefix(wantName, "*") {
    						wantName = wantName[1:]
    					}
    					if i := strings.Index(wantName, "+"); i >= 0 {
    						wantName = wantName[:i]
    					}
    				}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 29 18:31:05 GMT 2023
    - 23.9K bytes
    - Viewed (0)
  4. src/bytes/bytes.go

    	b := bytealg.MakeNoZero(n)[:n:n]
    	bp := copy(b, s[0])
    	for _, v := range s[1:] {
    		bp += copy(b[bp:], sep)
    		bp += copy(b[bp:], v)
    	}
    	return b
    }
    
    // HasPrefix reports whether the byte slice s begins with prefix.
    func HasPrefix(s, prefix []byte) bool {
    	return len(s) >= len(prefix) && Equal(s[0:len(prefix)], prefix)
    }
    
    // HasSuffix reports whether the byte slice s ends with suffix.
    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. misc/ios/go_ios_exec.go

    	var env []string
    	for _, e := range os.Environ() {
    		// Don't override TMPDIR, HOME, GOCACHE on the device.
    		if strings.HasPrefix(e, "TMPDIR=") || strings.HasPrefix(e, "HOME=") || strings.HasPrefix(e, "GOCACHE=") {
    			continue
    		}
    		env = append(env, e)
    	}
    	lldb := exec.Command(
    		"python",
    		"-", // Read script from stdin.
    		target,
    		appdir,
    		deviceapp,
    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)
  6. src/cmd/asm/internal/asm/endtoend_test.go

    	lines := strings.SplitAfter(string(data), "\n")
    Diff:
    	for _, line := range lines {
    		lineno++
    
    		// Ignore include of textflag.h.
    		if strings.HasPrefix(line, "#include ") {
    			continue
    		}
    
    		// Ignore GLOBL.
    		if strings.HasPrefix(line, "GLOBL ") {
    			continue
    		}
    
    		// The general form of a test input line is:
    		//	// comment
    		//	INST args [// printed form] [// hex encoding]
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Dec 07 18:42:59 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  7. src/cmd/api/main_test.go

    		exitCode = 1
    	}
    	if filepath.Base(filename) == "go1.4.txt" {
    		// No use for blank lines in api files, except go1.4.txt
    		// used them in a reasonable way and we should let it be.
    	} else if strings.HasPrefix(s, "\n") || strings.Contains(s, "\n\n") {
    		log.Printf("%s: contains a blank line", filename)
    		exitCode = 1
    	}
    	if s == "" {
    		log.Printf("%s: empty file", filename)
    		exitCode = 1
    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)
  8. src/archive/zip/reader.go

    func toValidName(name string) string {
    	name = strings.ReplaceAll(name, `\`, `/`)
    	p := path.Clean(name)
    
    	p = strings.TrimPrefix(p, "/")
    
    	for strings.HasPrefix(p, "../") {
    		p = p[len("../"):]
    	}
    
    	return p
    }
    
    func (r *Reader) initFileList() {
    	r.fileListOnce.Do(func() {
    		// files and knownDirs map from a file/directory name
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  9. src/cmd/asm/internal/arch/arch.go

    		return archRISCV64(shared)
    	case "s390x":
    		return archS390x()
    	case "wasm":
    		return archWasm()
    	}
    	return nil
    }
    
    func jumpX86(word string) bool {
    	return word[0] == 'J' || word == "CALL" || strings.HasPrefix(word, "LOOP") || word == "XBEGIN"
    }
    
    func jumpRISCV(word string) bool {
    	switch word {
    	case "BEQ", "BEQZ", "BGE", "BGEU", "BGEZ", "BGT", "BGTU", "BGTZ", "BLE", "BLEU", "BLEZ",
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Mar 21 06:51:28 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  10. src/archive/tar/common.go

    			switch _, exists := paxHdrs[k]; {
    			case exists:
    				continue // Do not overwrite existing records
    			case h.Typeflag == TypeXGlobalHeader:
    				paxHdrs[k] = v // Copy all records
    			case !basicKeys[k] && !strings.HasPrefix(k, paxGNUSparse):
    				paxHdrs[k] = v // Ignore local records that may conflict
    			}
    		}
    		whyOnlyPAX = "only PAX supports PAXRecords"
    		format.mayOnlyBe(FormatPAX)
    	}
    	for k, v := range paxHdrs {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
Back to top