Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for ModCompare (0.14 sec)

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

    	"cmd/go/internal/modfetch"
    	"cmd/go/internal/modfetch/codehost"
    
    	"golang.org/x/mod/module"
    )
    
    // cmpVersion implements the comparison for versions in the module loader.
    //
    // It is consistent with gover.ModCompare except that as a special case,
    // the version "" is considered higher than all other versions.
    // The main module (also known as the target) has no version and must be chosen
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:01:38 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. src/cmd/go/internal/gover/mod_test.go

    var isToolchainTests = []testCase1[string, bool]{
    	{"go", true},
    	{"toolchain", true},
    	{"anything", false},
    	{"golang.org/toolchain", false},
    }
    
    func TestModCompare(t *testing.T) { test3(t, modCompareTests, "ModCompare", ModCompare) }
    
    var modCompareTests = []testCase3[string, string, string, int]{
    	{"go", "1.2", "1.3", -1},
    	{"go", "v1.2", "v1.3", 0}, // equal because invalid
    	{"go", "1.2", "1.2", 0},
    	{"toolchain", "go1.2", "go1.3", -1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 25 17:51:28 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. src/cmd/go/internal/gover/mod.go

    	return path == "go" || path == "toolchain"
    }
    
    // ModCompare returns the result of comparing the versions x and y
    // for the module with the given path.
    // The path is necessary because the "go" and "toolchain" modules
    // use a different version syntax and semantics (gover, this package)
    // than most modules (semver).
    func ModCompare(path string, x, y string) int {
    	if path == "go" {
    		return Compare(x, y)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 06 19:18:46 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modload/query.go

    		}
    		qm.filter = func(mv string) bool { return gover.ModCompare(qm.path, mv, v) <= 0 }
    		if !matchesMajor(v) {
    			qm.preferIncompatible = true
    		}
    
    	case strings.HasPrefix(query, "<"):
    		v := query[len("<"):]
    		if !gover.ModIsValid(path, v) {
    			return badVersion(v)
    		}
    		qm.filter = func(mv string) bool { return gover.ModCompare(qm.path, mv, v) < 0 }
    		if !matchesMajor(v) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 11 22:29:11 UTC 2023
    - 44.7K bytes
    - Viewed (0)
  5. src/cmd/go/internal/modload/edit.go

    			// the conflict. Find the next-lowest candidate and apply it.
    			rejectedRoot[m] = true
    			prev := m
    			for {
    				prev, err = previousVersion(ctx, prev)
    				if gover.ModCompare(m.Path, m.Version, origV) > 0 && (gover.ModCompare(m.Path, prev.Version, origV) < 0 || err != nil) {
    					// previousVersion skipped over origV. Insert it into the order.
    					prev.Version = origV
    				} else if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 15 21:46:32 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modfetch/toolchain.go

    	versions, err := r.Versions(ctx, "")
    	if err != nil {
    		return nil, err
    	}
    	var max string
    	for _, v := range versions.List {
    		if max == "" || gover.ModCompare(r.path, v, max) > 0 {
    			max = v
    		}
    	}
    	return r.Stat(ctx, max)
    }
    
    func (r *toolchainRepo) GoMod(ctx context.Context, version string) (data []byte, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 13 16:44:24 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modload/buildlist.go

    		if i > 0 {
    			prev := rootModules[i-1]
    			if prev.Path > m.Path || (prev.Path == m.Path && gover.ModCompare(m.Path, prev.Version, m.Version) > 0) {
    				panic(fmt.Sprintf("newRequirements called with unsorted roots: %v", rootModules))
    			}
    		}
    
    		if v, ok := rs.maxRootVersion[m.Path]; ok && gover.ModCompare(m.Path, v, m.Version) >= 0 {
    			continue
    		}
    		rs.maxRootVersion[m.Path] = m.Version
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 16:04:44 UTC 2024
    - 53.8K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modload/vendor.go

    				// is in the build list and is the selected version of its path.
    				// If this information is new, record it.
    				if v, ok := vendorVersion[mod.Path]; !ok || gover.ModCompare(mod.Path, v, mod.Version) < 0 {
    					vendorList = append(vendorList, mod)
    					vendorVersion[mod.Path] = mod.Version
    				}
    			}
    		}
    	})
    }
    
    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/modload/modfile.go

    	}
    	summary, err := rawGoModSummary(rm)
    	if err != nil {
    		return err
    	}
    
    	var rationale []string
    	isRetracted := false
    	for _, r := range summary.retract {
    		if gover.ModCompare(m.Path, r.Low, m.Version) <= 0 && gover.ModCompare(m.Path, m.Version, r.High) <= 0 {
    			isRetracted = true
    			if r.Rationale != "" {
    				rationale = append(rationale, r.Rationale)
    			}
    		}
    	}
    	if isRetracted {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 17:53:40 UTC 2023
    - 26.7K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modload/build.go

    		// authenticated.
    		return
    	} else if err != nil {
    		if m.Error == nil {
    			m.Error = &modinfo.ModuleError{Err: err.Error()}
    		}
    		return
    	}
    
    	if gover.ModCompare(m.Path, info.Version, m.Version) > 0 {
    		m.Update = &modinfo.ModulePublic{
    			Path:    m.Path,
    			Version: info.Version,
    			Time:    &info.Time,
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 16:56:39 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top