Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for ImportSpec (0.24 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nFuncType
    	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)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    		}
    
    		// Add special dot-import declaration:
    		//    import . "·this·"
    		var decls []ast.Decl
    		decls = append(decls, &ast.GenDecl{
    			Tok: token.IMPORT,
    			Specs: []ast.Spec{
    				&ast.ImportSpec{
    					Name: &ast.Ident{Name: "."},
    					Path: &ast.BasicLit{
    						Kind:  token.STRING,
    						Value: strconv.Quote(thispkg),
    					},
    				},
    			},
    		})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  10. 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)
Back to top