Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for AllowMissingModuleImports (0.33 sec)

  1. src/cmd/go/internal/modload/import_test.go

    	testenv.MustHaveExternalNetwork(t)
    	testenv.MustHaveExecPath(t, "git")
    
    	oldAllowMissingModuleImports := allowMissingModuleImports
    	oldRootMode := RootMode
    	defer func() {
    		allowMissingModuleImports = oldAllowMissingModuleImports
    		RootMode = oldRootMode
    	}()
    	allowMissingModuleImports = true
    	RootMode = NoRoot
    
    	ctx := context.Background()
    	rs := LoadModFile(ctx)
    
    	for _, tt := range importTests {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 20 15:29:06 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  2. src/cmd/go/internal/run/run.go

    		// before loading packages, since it affects package locations, e.g.,
    		// for -race and -msan.
    		modload.ForceUseModules = true
    		modload.RootMode = modload.NoRoot
    		modload.AllowMissingModuleImports()
    		modload.Init()
    	} else {
    		modload.InitWorkfile()
    	}
    
    	work.BuildInit()
    	b := work.NewBuilder("")
    	defer func() {
    		if err := b.Close(); err != nil {
    			base.Fatal(err)
    		}
    	}()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 19:09:38 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  3. src/cmd/go/internal/modload/init.go

    //
    // This function affects the default cfg.BuildMod when outside of a module,
    // so it can only be called prior to Init.
    func AllowMissingModuleImports() {
    	if initialized {
    		panic("AllowMissingModuleImports after Init")
    	}
    	allowMissingModuleImports = true
    }
    
    // makeMainModules creates a MainModuleSet and associated variables according to
    // the given main modules.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:36:30 UTC 2024
    - 69.8K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modload/import.go

    		}
    		if e.QueryErr != nil && e.QueryErr != ErrNoModRoot {
    			return fmt.Sprintf("cannot find module providing package %s: %v", e.Path, e.QueryErr)
    		}
    		if cfg.BuildMod == "mod" || (cfg.BuildMod == "readonly" && allowMissingModuleImports) {
    			return "cannot find module providing package " + e.Path
    		}
    
    		if e.replaced.Path != "" {
    			suggestArg := e.replaced.Path
    			if !module.IsZeroPseudoVersion(e.replaced.Version) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 15:21:14 UTC 2024
    - 27.7K bytes
    - Viewed (0)
  5. src/cmd/go/internal/work/build.go

    //
    // See golang.org/issue/40276 for details and rationale.
    func installOutsideModule(ctx context.Context, args []string) {
    	modload.ForceUseModules = true
    	modload.RootMode = modload.NoRoot
    	modload.AllowMissingModuleImports()
    	modload.Init()
    	BuildInit()
    
    	// Load packages. Ignore non-main packages.
    	// Print a warning if an argument contains "..." and matches no main packages.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 17:22:59 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modget/get.go

    	// what was requested.
    	modload.ExplicitWriteGoMod = true
    
    	// Allow looking up modules for import paths when outside of a module.
    	// 'go get' is expected to do this, unlike other commands.
    	modload.AllowMissingModuleImports()
    
    	// 'go get' no longer builds or installs packages, so there's nothing to do
    	// if there's no go.mod file.
    	// TODO(#40775): make modload.Init return ErrNoModRoot instead of exiting.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 18:26:32 UTC 2024
    - 66.5K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modload/load.go

    			// version specified by a new root than add a new dependency on an
    			// unrelated version.
    			continue
    		}
    
    		if !ld.ResolveMissingImports || (!HasModRoot() && !allowMissingModuleImports) {
    			// We've loaded as much as we can without resolving missing imports.
    			break
    		}
    
    		modAddedBy, err := ld.resolveMissingImports(ctx)
    		if err != nil {
    			ld.error(err)
    			break
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 14:56:56 UTC 2024
    - 84K bytes
    - Viewed (0)
Back to top