- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for importSpec (0.27 sec)
-
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go
func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { var groups [][]*ast.ImportSpec for _, decl := range f.Decls { genDecl, ok := decl.(*ast.GenDecl) if !ok || genDecl.Tok != token.IMPORT { break } group := []*ast.ImportSpec{} var lastLine int for _, spec := range genDecl.Specs { importSpec := spec.(*ast.ImportSpec) pos := importSpec.Path.ValuePos line := fset.Position(pos).Line
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 10 21:56:21 UTC 2022 - 13.4K bytes - Viewed (0) -
src/cmd/fix/fix.go
} } after(x) } // imports reports whether f imports path. func imports(f *ast.File, path string) bool { return importSpec(f, path) != nil } // importSpec returns the import spec if f imports path, // or nil otherwise. func importSpec(f *ast.File, path string) *ast.ImportSpec { for _, s := range f.Imports { if importPath(s) == path { return s } } return nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 14.6K 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/cmd/cgo/ast.go
sawC := false for _, decl := range ast1.Decls { switch decl := decl.(type) { case *ast.GenDecl: for _, spec := range decl.Specs { s, ok := spec.(*ast.ImportSpec) if !ok || s.Path.Value != `"C"` { continue } sawC = true if s.Name != nil { error_(s.Path.Pos(), `cannot rename import "C"`) } cg := s.Doc
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 07 16:54:27 UTC 2023 - 14.3K bytes - Viewed (0) -
src/go/ast/ast.go
// constant, type, or variable declaration. type ( // The Spec type stands for any of *ImportSpec, *ValueSpec, and *TypeSpec. Spec interface { Node specNode() } // An ImportSpec node represents a single package import. ImportSpec struct { Doc *CommentGroup // associated documentation; or nil Name *Ident // local package name (including "."); or nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
case *ast.Ident: children = append(children, tok(n.NamePos, len(n.Name))) case *ast.IfStmt: children = append(children, tok(n.If, len("if"))) case *ast.ImportSpec: // TODO(adonovan): ImportSpec.{Doc,EndPos}? case *ast.IncDecStmt: children = append(children, tok(n.TokPos, len(n.Tok.String()))) case *ast.IndexExpr: children = append(children,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K 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/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 11.2K 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/cmd/go/internal/modindex/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: Thu Feb 23 10:10:21 UTC 2023 - 13K bytes - Viewed (0)