- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 32 for importSpec (0.32 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/ast/commentmap_test.go
var res = map[string]string{ " 5: *ast.File": "the very first comment\npackage p\n", " 5: *ast.Ident": " the name is p\n", " 8: *ast.GenDecl": "imports\n", " 9: *ast.ImportSpec": "bytes\n", "10: *ast.ImportSpec": "fmt\n", "16: *ast.GenDecl": "T\nalso associated with T\n", "17: *ast.Field": "associated with a, b, c\n", "19: *ast.Field": "associated with x, y\nfloat values\n",
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 15:35:30 UTC 2022 - 3.9K 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) -
api/go1.22.txt
pkg go/types, method (*Alias) String() string #63223 pkg go/types, method (*Alias) Underlying() Type #63223 pkg go/types, method (*Info) PkgNameOf(*ast.ImportSpec) *PkgName #62037 pkg go/types, method (Checker) PkgNameOf(*ast.ImportSpec) *PkgName #62037 pkg go/types, type Alias struct #63223 pkg go/types, type Info struct, FileVersions map[*ast.File]string #62605 pkg go/version, func Compare(string, string) int #62039
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 24 20:54:27 UTC 2024 - 7.7K 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/ast/inspector/typeof.go
case *ast.GenDecl: return 1 << nGenDecl case *ast.GoStmt: return 1 << nGoStmt case *ast.Ident: return 1 << nIdent case *ast.IfStmt: return 1 << nIfStmt case *ast.ImportSpec: return 1 << nImportSpec case *ast.IncDecStmt: return 1 << nIncDecStmt case *ast.IndexExpr: return 1 << nIndexExpr case *ast.IndexListExpr: return 1 << nIndexListExpr case *ast.InterfaceType:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 4.8K bytes - Viewed (0) -
src/go/ast/scope.go
func (obj *Object) Pos() token.Pos { name := obj.Name switch d := obj.Decl.(type) { case *Field: for _, n := range d.Names { if n.Name == name { return n.Pos() } } case *ImportSpec: if d.Name != nil && d.Name.Name == name { return d.Name.Pos() } return d.Path.Pos() case *ValueSpec: for _, n := range d.Names { if n.Name == name { return n.Pos() } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 4.6K bytes - Viewed (0)