- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for HasPrefix (0.18 sec)
-
src/cmd/api/api_test.go
*context = build.Default context.Dir = filepath.Join(testenv.GOROOT(t), "src") w := NewWalker(context, context.Dir) for _, pkg := range w.stdPackages { if strings.HasPrefix(pkg, "vendor/") || strings.HasPrefix(pkg, "golang.org/x/") { t.Fatalf("stdPackages contains unexpected package %s", pkg) } } } func TestIssue64958(t *testing.T) { defer func() { if x := recover(); x != nil {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Jan 04 17:31:12 GMT 2024 - 7.1K bytes - Viewed (0) -
src/cmd/cgo/internal/test/issue1435.go
break } // Fall through in the unlikely case // that filter at some point is // "Pid:\t". } if strings.HasPrefix(line, filter) { if line == expected { foundAThread = true break } if filter == "Groups:" && strings.HasPrefix(line, "Groups:\t") { // https://github.com/golang/go/issues/46145
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri Jul 28 21:31:41 GMT 2023 - 7.5K bytes - Viewed (0) -
src/cmd/cgo/gcc.go
func cname(s string) string { if t, ok := nameToC[s]; ok { return t } if strings.HasPrefix(s, "struct_") { return "struct " + s[len("struct_"):] } if strings.HasPrefix(s, "union_") { return "union " + s[len("union_"):] } if strings.HasPrefix(s, "enum_") { return "enum " + s[len("enum_"):] } if strings.HasPrefix(s, "sizeof_") { return "sizeof(" + cname(s[len("sizeof_"):]) + ")" } return s }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Nov 02 16:43:23 GMT 2023 - 97K bytes - Viewed (0) -
src/cmd/cgo/internal/test/callback_windows.go
continue } // In module mode, this package has a fully-qualified import path. // Remove it if present. fname = strings.TrimPrefix(fname, "cmd/cgo/internal/") if !strings.HasPrefix(fname, "test.") { continue } got = append(got, fname) } if !reflect.DeepEqual(want, got) { t.Errorf("incorrect backtrace:\nwant:\t%v\ngot:\t%v", want, got) }
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Wed Nov 29 16:01:37 GMT 2023 - 2.6K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
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)