- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 310 for parseDir (0.14 sec)
-
src/go/parser/parser_test.go
} } func TestParseDir(t *testing.T) { path := "." pkgs, err := ParseDir(token.NewFileSet(), path, dirFilter, 0) if err != nil { t.Fatalf("ParseDir(%s): %v", path, err) } if n := len(pkgs); n != 1 { t.Errorf("got %d packages; want 1", n) } pkg := pkgs["parser"] if pkg == nil { t.Errorf(`package "parser" not found`) return } if n := len(pkg.Files); n != 3 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K bytes - Viewed (0) -
src/go/parser/interface.go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the exported entry points for invoking the parser. package parser import ( "bytes" "errors" "go/ast" "go/token" "io" "io/fs" "os" "path/filepath" "strings" ) // If src != nil, readSource converts src to a []byte if possible;
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 7.5K bytes - Viewed (0) -
src/internal/reflectlite/reflect_mirror_test.go
} return v } func loadTypes(path, pkgName string, v visitor) { fset := token.NewFileSet() filter := func(fi fs.FileInfo) bool { return strings.HasSuffix(fi.Name(), ".go") } pkgs, err := parser.ParseDir(fset, path, filter, 0) if err != nil { panic(err) } pkg := pkgs[pkgName] for _, f := range pkg.Files { ast.Walk(v, f) } } func TestMirrorWithReflect(t *testing.T) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 21:11:15 UTC 2024 - 2.8K bytes - Viewed (0) -
cmd/preferredimports/preferredimports.go
func (a *analyzer) collect(dir string) { if _, ok := a.donePaths[dir]; ok { return } a.donePaths[dir] = nil // Create the AST by parsing src. fs, err := parser.ParseDir(a.fset, dir, nil, parser.AllErrors|parser.ParseComments) if err != nil { fmt.Fprintln(os.Stderr, "ERROR(syntax)", logPrefix, err) a.failed = true return } for _, p := range fs {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Mar 01 06:06:44 UTC 2024 - 7.1K bytes - Viewed (0) -
src/cmd/doc/pkg.go
} } for _, name := range pkg.CgoFiles { if name == info.Name() { return true } } return false } fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, pkg.Dir, include, parser.ParseComments) if err != nil { log.Fatal(err) } // Make sure they are all in one package. if len(pkgs) == 0 { log.Fatalf("no source-code package in directory %s", pkg.Dir) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 08 20:15:52 UTC 2024 - 32K bytes - Viewed (0) -
hack/verify-netparse-cve.sh
echo >&2 echo "Run ./hack/update-netparse-cve.sh" >&2 echo >&2 rc=1 fi # find files using net.ParseCIDR() netparsecidrs_matches=$(find_files | xargs grep -nE "net.ParseCIDR\(.*\)" 2>/dev/null) || true if [[ -n "${netparsecidrs_matches}" ]]; then echo "net.ParseCIDR reject leading zeros in the dot-decimal notation of IPv4 addresses since golang 1.17:" >&2 echo "${netparsecidrs_matches}" >&2 echo >&2
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Mar 01 06:07:31 UTC 2024 - 2.3K bytes - Viewed (0) -
src/go/parser/parser.go
fmt.Println(a...) } func trace(p *parser, msg string) *parser { p.printTrace(msg, "(") p.indent++ return p } // Usage pattern: defer un(trace(p, "...")) func un(p *parser) { p.indent-- p.printTrace(")") } // maxNestLev is the deepest we're willing to recurse during parsing const maxNestLev int = 1e5 func incNestLev(p *parser) *parser { p.nestLev++ if p.nestLev > maxNestLev {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Dec 08 20:07:50 UTC 2023 - 72.2K bytes - Viewed (0) -
src/crypto/x509/parser.go
} rdnSet = append(rdnSet, attr) } rdnSeq = append(rdnSeq, rdnSet) } return &rdnSeq, nil } func parseAI(der cryptobyte.String) (pkix.AlgorithmIdentifier, error) { ai := pkix.AlgorithmIdentifier{} if !der.ReadASN1ObjectIdentifier(&ai.Algorithm) { return ai, errors.New("x509: malformed OID") } if der.Empty() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:00:16 UTC 2024 - 38.5K bytes - Viewed (0) -
src/go/internal/gccgoimporter/parser.go
} func (p *parser) error(err any) { if s, ok := err.(string); ok { err = errors.New(s) } // panic with a runtime.Error if err is not an error panic(importError{p.scanner.Pos(), err.(error)}) } func (p *parser) errorf(format string, args ...any) { p.error(fmt.Errorf(format, args...)) } func (p *parser) expect(tok rune) string { lit := p.lit if p.tok != tok {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 02 23:14:07 UTC 2024 - 31.2K bytes - Viewed (0) -
src/net/ip_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 07 01:17:29 UTC 2024 - 25.7K bytes - Viewed (0)