Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for WorkFile (0.18 sec)

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

    		workFile.DropToolchainStmt()
    	} else if *editToolchain != "" {
    		if err := workFile.AddToolchainStmt(*editToolchain); err != nil {
    			base.Fatalf("go: internal error: %v", err)
    		}
    	}
    
    	if len(workedits) > 0 {
    		for _, edit := range workedits {
    			edit(workFile)
    		}
    	}
    
    	workFile.SortBlocks()
    	workFile.Cleanup() // clean file after edits
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 13:52:10 UTC 2024
    - 11K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/mod/modfile/work.go

    	}
    	f.SortBlocks()
    }
    
    func (f *WorkFile) DropUse(path string) error {
    	for _, d := range f.Use {
    		if d.Path == path {
    			d.Syntax.markRemoved()
    			*d = Use{}
    		}
    	}
    	return nil
    }
    
    func (f *WorkFile) AddReplace(oldPath, oldVers, newPath, newVers string) error {
    	return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers)
    }
    
    func (f *WorkFile) DropReplace(oldPath, oldVers string) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 18:34:56 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  3. src/cmd/go/internal/telemetrystats/telemetrystats.go

    }
    
    // incrementConfig increments counters for the configuration
    // the command is running in.
    func incrementConfig() {
    	if !modload.WillBeEnabled() {
    		telemetry.Inc("go/mode:gopath")
    	} else if workfile := modload.FindGoWork(base.Cwd()); workfile != "" {
    		telemetry.Inc("go/mode:workspace")
    	} else {
    		telemetry.Inc("go/mode:module")
    	}
    	telemetry.Inc("go/platform/target/goos:" + cfg.Goos)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:09:11 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modload/init.go

    		indices:         map[module.Version]*modFileIndex{},
    		highestReplaced: map[string]string{},
    		workFile:        workFile,
    	}
    	var workFileReplaces []*modfile.Replace
    	if workFile != nil {
    		workFileReplaces = workFile.Replace
    		mainModules.workFileReplaceMap = toReplaceMap(workFile.Replace)
    	}
    	mainModulePaths := make(map[string]bool)
    	for _, m := range ms {
    		if mainModulePaths[m.Path] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:36:30 UTC 2024
    - 69.8K bytes
    - Viewed (0)
  5. src/cmd/go/internal/modcmd/vendor.go

    		// directory can't otherwise determine that those replacements had no effect.
    		for _, m := range modload.MainModules.Versions() {
    			if workFile := modload.MainModules.WorkFile(); workFile != nil {
    				for _, r := range workFile.Replace {
    					if replacementWritten[r.Old] {
    						// We already recorded this replacement.
    						continue
    					}
    					replacementWritten[r.Old] = true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 14:19:59 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  6. src/cmd/go/internal/workcmd/init.go

    	}
    
    	if _, err := fsys.Stat(gowork); err == nil {
    		base.Fatalf("go: %s already exists", gowork)
    	}
    
    	goV := gover.Local() // Use current Go version by default
    	wf := new(modfile.WorkFile)
    	wf.Syntax = new(modfile.FileSyntax)
    	wf.AddGoStmt(goV)
    	workUse(ctx, gowork, wf, args)
    	modload.WriteWorkFile(gowork, wf)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  7. src/cmd/go/internal/workcmd/use.go

    	wf, err := modload.ReadWorkFile(gowork)
    	if err != nil {
    		base.Fatal(err)
    	}
    	workUse(ctx, gowork, wf, args)
    	modload.WriteWorkFile(gowork, wf)
    }
    
    func workUse(ctx context.Context, gowork string, wf *modfile.WorkFile, args []string) {
    	workDir := filepath.Dir(gowork) // absolute, since gowork itself is absolute
    
    	haveDirs := make(map[string][]string) // absolute → original(s)
    	for _, use := range wf.Use {
    		var abs string
    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/modload/vendor.go

    			}
    		}
    	}
    	for _, modFile := range modFiles {
    		checkReplace(modFile.Replace)
    	}
    	if MainModules.workFile != nil {
    		checkReplace(MainModules.workFile.Replace)
    	}
    
    	for _, mod := range vendorList {
    		meta := vendorMeta[mod]
    		if meta.Explicit {
    			// in workspace mode, check that it's required by at least one of the main modules
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 24 18:09:22 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  9. src/cmd/go/internal/gover/version.go

    	}
    	return mf.Go.Version
    }
    
    // FromGoWork returns the go version from the go.mod file.
    // It returns DefaultGoWorkVersion if the go.mod file does not contain a go line or if wf is nil.
    func FromGoWork(wf *modfile.WorkFile) string {
    	if wf == nil || wf.Go == nil {
    		return DefaultGoWorkVersion
    	}
    	return wf.Go.Version
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 15:21:14 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/mod/modfile/rule.go

    			args = args[1:]
    		}
    		vi, err := parseVersionInterval("retract", path, &args, fix)
    		if err != nil {
    			wrapError(err)
    		}
    		r.VersionInterval = vi
    	}
    }
    
    func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, fix VersionFixer) {
    	wrapError := func(err error) {
    		*errs = append(*errs, Error{
    			Filename: f.Syntax.Name,
    			Pos:      line.Start,
    			Err:      err,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 18:34:56 UTC 2024
    - 46.5K bytes
    - Viewed (0)
Back to top