this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

all: remove two deprecated APIs

semver.Max was an internal deprecated API that was only used in tests.
It doesn't need to stay around for even a single release.

modfile.LatestKnownSchemaVersion was marked for deletion in v0.11;
now that we've tagged v0.10.0, it can go as well.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie5f50d848e56a5a7876fe91617bad1f1742160ab
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199545
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

-43
-14
internal/mod/semver/semver.go
··· 140 140 return comparePrerelease(pv.prerelease, pw.prerelease) 141 141 } 142 142 143 - // Max canonicalizes its arguments and then returns the version string 144 - // that compares greater. 145 - // 146 - // Deprecated: use Compare instead. In most cases, returning a canonicalized 147 - // version is not expected or desired. 148 - func Max(v, w string) string { 149 - v = Canonical(v) 150 - w = Canonical(w) 151 - if Compare(v, w) > 0 { 152 - return v 153 - } 154 - return w 155 - } 156 - 157 143 // Sort sorts a list of semantic version strings. 158 144 func Sort(list []string) { 159 145 slices.SortFunc(list, func(a, b string) int {
-15
internal/mod/semver/semver_test.go
··· 169 169 } 170 170 } 171 171 172 - func TestMax(t *testing.T) { 173 - for i, ti := range tests { 174 - for j, tj := range tests { 175 - max := Max(ti.in, tj.in) 176 - want := Canonical(ti.in) 177 - if i < j { 178 - want = Canonical(tj.in) 179 - } 180 - if max != want { 181 - t.Errorf("Max(%q, %q) = %q, want %q", ti.in, tj.in, max, want) 182 - } 183 - } 184 - } 185 - } 186 - 187 172 var ( 188 173 v1 = "v1.0.0+metadata-dash" 189 174 v2 = "v1.0.0+metadata-dash1"
-9
mod/modfile/modfile.go
··· 248 248 return earliest 249 249 }) 250 250 251 - // LatestKnownSchemaVersion returns the language version 252 - // associated with the most recent known schema. 253 - // 254 - // Deprecated: use [cuelang.org/go/cue.LanguageVersion] instead. This 255 - // function will be removed in v0.11. 256 - func LatestKnownSchemaVersion() string { 257 - return cueversion.LanguageVersion() 258 - } 259 - 260 251 // Parse verifies that the module file has correct syntax 261 252 // and follows the schema following the required language.version field. 262 253 // The file name is used for error messages.
-5
mod/modfile/modfile_test.go
··· 23 23 24 24 "cuelang.org/go/cue/errors" 25 25 "cuelang.org/go/internal/cuetest" 26 - "cuelang.org/go/internal/cueversion" 27 26 "cuelang.org/go/mod/module" 28 27 ) 29 28 ··· 543 542 544 543 func TestEarliestClosedSchemaVersion(t *testing.T) { 545 544 qt.Assert(t, qt.Equals(EarliestClosedSchemaVersion(), "v0.8.0-alpha.0")) 546 - } 547 - 548 - func TestLatestKnownSchemaVersion(t *testing.T) { 549 - qt.Assert(t, qt.Equals(LatestKnownSchemaVersion(), cueversion.LanguageVersion())) 550 545 } 551 546 552 547 func parseVersions(vs ...string) []module.Version {