Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ModIsValid (0.18 sec)

  1. src/cmd/go/internal/gover/mod.go

    			vj, fj = vj[:k], vj[k:]
    		}
    		if vi != vj {
    			return ModCompare(mi.Path, vi, vj) < 0
    		}
    		return fi < fj
    	})
    }
    
    // ModIsValid reports whether vers is a valid version syntax for the module with the given path.
    func ModIsValid(path, vers string) bool {
    	if IsToolchain(path) {
    		if path == "toolchain" {
    			return IsValid(FromToolchain(vers))
    		}
    		return IsValid(vers)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 06 19:18:46 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  2. src/cmd/go/internal/gover/mod_test.go

    	{"rsc.io/quote", "v1.2", "v1.3", -1},
    	{"rsc.io/quote", "1.2", "1.3", 0}, // equal because invalid
    }
    
    func TestModIsValid(t *testing.T) { test2(t, modIsValidTests, "ModIsValid", ModIsValid) }
    
    var modIsValidTests = []testCase2[string, string, bool]{
    	{"go", "1.2", true},
    	{"go", "v1.2", false},
    	{"toolchain", "go1.2", true},
    	{"toolchain", "v1.2", false},
    	{"rsc.io/quote", "v1.2", true},
    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/modfetch/cache.go

    	if gover.IsToolchain(m.Path) {
    		return "", ErrToolchain
    	}
    	dir, err := cacheDir(ctx, m.Path)
    	if err != nil {
    		return "", err
    	}
    	if !gover.ModIsValid(m.Path, m.Version) {
    		return "", fmt.Errorf("non-semver module version %q", m.Version)
    	}
    	if module.CanonicalVersion(m.Version) != m.Version {
    		return "", fmt.Errorf("non-canonical module version %q", m.Version)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 18:15:22 UTC 2024
    - 24.7K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modload/query.go

    	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) {
    			qm.preferIncompatible = true
    		}
    
    	case strings.HasPrefix(query, ">="):
    		v := query[len(">="):]
    		if !gover.ModIsValid(path, v) {
    			return badVersion(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/modfile.go

    		} else {
    			data, err = lockedfile.Read(gomodActual)
    		}
    		if err != nil {
    			return "", nil, module.VersionError(m, fmt.Errorf("reading %s: %v", base.ShortPath(name), err))
    		}
    	} else {
    		if !gover.ModIsValid(m.Path, m.Version) {
    			// Disallow the broader queries supported by fetch.Lookup.
    			base.Fatalf("go: internal error: %s@%s: unexpected invalid semantic version", m.Path, m.Version)
    		}
    		name = "go.mod"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 17:53:40 UTC 2023
    - 26.7K bytes
    - Viewed (0)
Back to top