- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for importSpec (0.14 sec)
-
src/go/ast/import.go
} func importPath(s Spec) string { t, err := strconv.Unquote(s.(*ImportSpec).Path.Value) if err == nil { return t } return "" } func importName(s Spec) string { n := s.(*ImportSpec).Name if n == nil { return "" } return n.Name } func importComment(s Spec) string { c := s.(*ImportSpec).Comment if c == nil { return "" } return c.Text() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 5.7K bytes - Viewed (0) -
src/go/doc/example.go
func findImportGroupStarts(imps []*ast.ImportSpec) []token.Pos { startImps := findImportGroupStarts1(imps) groupStarts := make([]token.Pos, len(startImps)) for i, imp := range startImps { groupStarts[i] = imp.Pos() } return groupStarts } // Helper for findImportGroupStarts to ease testing. func findImportGroupStarts1(origImps []*ast.ImportSpec) []*ast.ImportSpec { // Copy to avoid mutation.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 21.4K bytes - Viewed (0) -
src/go/types/generate_test.go
func renameImportPath(f *ast.File, renames ...string) { m := makeRenameMap(renames...) ast.Inspect(f, func(n ast.Node) bool { switch n := n.(type) { case *ast.ImportSpec: if n.Path.Kind != token.STRING { panic("invalid import path") } m.rename(&n.Path.Value) return false } return true }) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 16.5K bytes - Viewed (0) -
src/go/types/api.go
// Implicits maps nodes to their implicitly declared objects, if any. // The following node and object types may appear: // // node declared object // // *ast.ImportSpec *PkgName for imports without renames // *ast.CaseClause type-specific *Var for each type switch case clause (incl. default) // *ast.Field anonymous parameter *Var (incl. unnamed results) //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 19:57:43 UTC 2024 - 17.2K bytes - Viewed (0) -
src/go/ast/walk.go
case *RangeStmt: if n.Key != nil { Walk(v, n.Key) } if n.Value != nil { Walk(v, n.Value) } Walk(v, n.X) Walk(v, n.Body) // Declarations case *ImportSpec: if n.Doc != nil { Walk(v, n.Doc) } if n.Name != nil { Walk(v, n.Name) } Walk(v, n.Path) if n.Comment != nil { Walk(v, n.Comment) } case *ValueSpec:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 16:34:10 UTC 2024 - 6.4K bytes - Viewed (0) -
src/go/ast/filter.go
for _, d := range decls { if d != nil { decls[i] = d i++ } } decls = decls[0:i] } } // Collect import specs from all package files. var imports []*ImportSpec if mode&FilterImportDuplicates != 0 { seen := make(map[string]bool) for _, filename := range filenames { f := pkg.Files[filename] for _, imp := range f.Imports {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 13.3K bytes - Viewed (0) -
src/go/types/decl.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 31K bytes - Viewed (0) -
src/go/types/api_test.go
continue } // extract Implicits entry, if any var got string for n, obj := range info.Implicits { switch x := n.(type) { case *ast.ImportSpec: got = "importSpec" case *ast.CaseClause: got = "caseClause" case *ast.Field: got = "field" default: t.Fatalf("package %s: unexpected %T", name, x) } got += ": " + obj.String()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 94.2K bytes - Viewed (0) -
src/go/build/read.go
} hasEmbed := false for _, decl := range info.parsed.Decls { d, ok := decl.(*ast.GenDecl) if !ok { continue } for _, dspec := range d.Specs { spec, ok := dspec.(*ast.ImportSpec) if !ok { continue } quoted := spec.Path.Value path, err := strconv.Unquote(quoted) if err != nil { return fmt.Errorf("parser returned invalid quoted string: <%s>", quoted) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 16:25:21 UTC 2024 - 14.1K bytes - Viewed (0) -
src/go/doc/reader.go
switch d := decl.(type) { case *ast.GenDecl: switch d.Tok { case token.IMPORT: // imports are handled individually for _, spec := range d.Specs { if s, ok := spec.(*ast.ImportSpec); ok { if import_, err := strconv.Unquote(s.Path.Value); err == nil { r.imports[import_] = 1 var name string if s.Name != nil { name = s.Name.Name if name == "." {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 27.5K bytes - Viewed (0)