- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 338 for Importer (0.2 sec)
-
src/go/importer/importer.go
// with the positions of objects created by the importer. func For(compiler string, lookup Lookup) types.Importer { return ForCompiler(token.NewFileSet(), compiler, lookup) } // Default returns an Importer for the compiler that built the running binary. // If available, the result implements [types.ImporterFrom]. func Default() types.Importer { return For(runtime.Compiler, nil) } // gc importer type gcimports struct {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 3.6K bytes - Viewed (0) -
src/go/types/resolver_test.go
if mode != 0 { panic("mode must be 0") } if imp.importer == nil { imp.importer = importer.Default().(ImporterFrom) imp.imported = make(map[string]bool) } pkg, err := imp.importer.ImportFrom(path, srcDir, mode) if err != nil { return nil, err } imp.imported[path] = true return pkg, nil } func TestResolveIdents(t *testing.T) { testenv.MustHaveGoBuild(t)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 4.5K bytes - Viewed (0) -
src/go/ast/resolve.go
} } return false } // An Importer resolves import paths to package Objects. // The imports map records the packages already imported, // indexed by package id (canonical import path). // An Importer must determine the canonical import path and // check the map to see if it is already present in the imports map. // If so, the Importer can return the map entry. Otherwise, the // Importer should load the package data for the given path into
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 5.4K bytes - Viewed (0) -
src/go/internal/srcimporter/srcimporter_test.go
} // Reimporting a partially imported (incomplete) package is not supported (see issue #19337). // Make sure we recognize the situation and report an error. mathPkg := types.NewPackage("math", "math") // incomplete package importer := New(&build.Default, token.NewFileSet(), map[string]*types.Package{mathPkg.Path(): mathPkg}) _, err := importer.ImportFrom("math", ".", 0)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 12:00:02 UTC 2023 - 6.5K bytes - Viewed (0) -
src/go/types/self_test.go
if err != nil { t.Fatal(err) } conf := Config{Importer: importer.Default()} _, err = conf.Check("go/types", fset, files, nil) if err != nil { t.Fatal(err) } } func BenchmarkCheck(b *testing.B) { testenv.MustHaveGoBuild(b) // The Go command is needed for the importer to determine the locations of stdlib .a files. for _, p := range []string{ "net/http", "go/parser", "go/constant",
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 23 19:39:00 UTC 2023 - 2.8K bytes - Viewed (0) -
src/cmd/compile/internal/types2/resolver_test.go
} // resolve and type-check package AST importer := new(resolveTestImporter) conf := Config{Importer: importer} uses := make(map[*syntax.Name]Object) defs := make(map[*syntax.Name]Object) _, err := conf.Check("testResolveIdents", files, &Info{Defs: defs, Uses: uses}) if err != nil { t.Fatal(err) } // check that all packages were imported for _, name := range pkgnames {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 10 12:59:20 UTC 2023 - 4.7K bytes - Viewed (0) -
src/go/internal/srcimporter/srcimporter.go
"os/exec" "path/filepath" "strings" "sync" _ "unsafe" // for go:linkname ) // An Importer provides the context for importing packages from source code. type Importer struct { ctxt *build.Context fset *token.FileSet sizes types.Sizes packages map[string]*types.Package } // New returns a new Importer for the given context, file set, and map
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 23 18:54:32 UTC 2022 - 8.2K bytes - Viewed (0) -
src/go/types/lookup_test.go
path := filepath.Join(runtime.GOROOT(), "src", "net", "http") fset := token.NewFileSet() files, err := pkgFiles(fset, path) if err != nil { b.Fatal(err) } conf := Config{ Importer: importer.Default(), } pkg, err := conf.Check("http", fset, files, nil) if err != nil { b.Fatal(err) } scope := pkg.Scope() names := scope.Names()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 13 15:31:43 UTC 2022 - 1.2K bytes - Viewed (0) -
src/go/types/sizes_test.go
const src = ` package a import "unsafe" const _ = unsafe.Offsetof(struct{ x int64 }{}.x) ` info := types.Info{Types: make(map[ast.Expr]types.TypeAndValue)} conf := types.Config{ Importer: importer.Default(), Sizes: &types.StdSizes{WordSize: 8, MaxAlign: 8}, } mustTypecheck(src, &conf, &info) for _, tv := range info.Types { _ = conf.Sizes.Sizeof(tv.Type) _ = conf.Sizes.Alignof(tv.Type) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 16 21:00:48 UTC 2023 - 4K bytes - Viewed (0) -
src/internal/types/errors/codes_test.go
package errors_test import ( "fmt" "go/ast" "go/constant" "go/importer" "go/parser" "go/token" "internal/testenv" "reflect" "strings" "testing" . "go/types" ) func TestErrorCodeExamples(t *testing.T) { testenv.MustHaveGoBuild(t) // go command needed to resolve std .a files for importer.Default(). walkCodes(t, func(name string, value int, spec *ast.ValueSpec) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 18 20:41:45 UTC 2022 - 4.9K bytes - Viewed (0)