Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for WorkFilePath (0.2 sec)

  1. src/cmd/go/internal/workcmd/sync.go

    				mustSelect = append(mustSelect, r)
    				inMustSelect[r] = true
    			}
    		}
    		gover.ModSort(mustSelect) // ensure determinism
    		mustSelectFor[m] = mustSelect
    	}
    
    	workFilePath := modload.WorkFilePath() // save go.work path because EnterModule clobbers it.
    
    	var goV string
    	for _, m := range mms.Versions() {
    		if mms.ModRoot(m) == "" && m.Path == "command-line-arguments" {
    			// This is not a real module.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  2. src/cmd/go/internal/modload/modfile.go

    				}
    				found, foundModRoot = r, modRoot
    			}
    		}
    	}
    	return found, foundModRoot, modFilePath(foundModRoot)
    }
    
    func replaceRelativeTo() string {
    	if workFilePath := WorkFilePath(); workFilePath != "" {
    		return filepath.Dir(workFilePath)
    	}
    	return MainModules.ModRoot(MainModules.mustGetSingleMainModule())
    }
    
    // canonicalizeReplacePath ensures that relative, on-disk, replaced module paths
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 17:53:40 UTC 2023
    - 26.7K bytes
    - Viewed (0)
  3. src/cmd/go/internal/modcmd/download.go

    	// Check whether modules are enabled and whether we're in a module.
    	modload.ForceUseModules = true
    	modload.ExplicitWriteGoMod = true
    	haveExplicitArgs := len(args) > 0
    
    	if modload.HasModRoot() || modload.WorkFilePath() != "" {
    		modload.LoadModFile(ctx) // to fill MainModules
    
    		if haveExplicitArgs {
    			for _, mainModule := range modload.MainModules.Versions() {
    				targetAtUpgrade := mainModule.Path + "@upgrade"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 19:32:39 UTC 2023
    - 13.5K bytes
    - Viewed (0)
  4. src/cmd/go/internal/workcmd/init.go

    	base.AddModCommonFlags(&cmdInit.Flag)
    }
    
    func runInit(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    
    	modload.ForceUseModules = true
    
    	gowork := modload.WorkFilePath()
    	if gowork == "" {
    		gowork = filepath.Join(base.Cwd(), "go.work")
    	}
    
    	if _, err := fsys.Stat(gowork); err == nil {
    		base.Fatalf("go: %s already exists", gowork)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  5. src/cmd/go/internal/workcmd/vendor.go

    	base.AddChdirFlag(&cmdVendor.Flag)
    	base.AddModCommonFlags(&cmdVendor.Flag)
    }
    
    func runVendor(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    	if modload.WorkFilePath() == "" {
    		base.Fatalf("go: no go.work file found\n\t(run 'go work init' first or specify path using GOWORK environment variable)")
    	}
    
    	modcmd.RunVendor(ctx, vendorE, vendorO, args)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 24 18:09:22 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modload/init.go

    			base.Fatalf("go: invalid GOWORK: not an absolute path")
    		}
    		return gowork
    	}
    }
    
    // WorkFilePath returns the absolute path of the go.work file, or "" if not in
    // workspace mode. WorkFilePath must be called after InitWorkfile.
    func WorkFilePath() string {
    	return workFilePath
    }
    
    // Reset clears all the initialized, cached state about the use of modules,
    // so that we can start over.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:36:30 UTC 2024
    - 69.8K bytes
    - Viewed (0)
  7. src/cmd/go/internal/workcmd/use.go

    	base.AddModCommonFlags(&cmdUse.Flag)
    }
    
    func runUse(ctx context.Context, cmd *base.Command, args []string) {
    	modload.ForceUseModules = true
    	modload.InitWorkfile()
    	gowork := modload.WorkFilePath()
    	if gowork == "" {
    		base.Fatalf("go: no go.work file found\n\t(run 'go work init' first or specify path using GOWORK environment variable)")
    	}
    	wf, err := modload.ReadWorkFile(gowork)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 7K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modcmd/vendor.go

    	base.AddChdirFlag(&cmdVendor.Flag)
    	base.AddModCommonFlags(&cmdVendor.Flag)
    }
    
    func runVendor(ctx context.Context, cmd *base.Command, args []string) {
    	modload.InitWorkfile()
    	if modload.WorkFilePath() != "" {
    		base.Fatalf("go: 'go mod vendor' cannot be run in workspace mode. Run 'go work vendor' to vendor the workspace or set 'GOWORK=off' to exit workspace mode.")
    	}
    	RunVendor(ctx, vendorE, vendorO, args)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 14:19:59 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  9. src/cmd/go/internal/workcmd/edit.go

    		base.Fatalf("go: 'go help work edit' accepts at most one argument")
    	}
    	var gowork string
    	if len(args) == 1 {
    		gowork = args[0]
    	} else {
    		modload.InitWorkfile()
    		gowork = modload.WorkFilePath()
    	}
    	if gowork == "" {
    		base.Fatalf("go: no go.work file found\n\t(run 'go work init' first or specify path using GOWORK environment variable)")
    	}
    
    	if *editGo != "" && *editGo != "none" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 13:52:10 UTC 2024
    - 11K bytes
    - Viewed (0)
  10. src/cmd/go/internal/envcmd/env.go

    	gomod := ""
    	modload.Init()
    	if modload.HasModRoot() {
    		gomod = modload.ModFilePath()
    	} else if modload.Enabled() {
    		gomod = os.DevNull
    	}
    	modload.InitWorkfile()
    	gowork := modload.WorkFilePath()
    	// As a special case, if a user set off explicitly, report that in GOWORK.
    	if cfg.Getenv("GOWORK") == "off" {
    		gowork = "off"
    	}
    	return []cfg.EnvVar{
    		{Name: "GOMOD", Value: gomod},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 17:13:51 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top