magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Make TestMustGetParsedDuration backwards compatible #63

Closed maage closed 2 years ago

maage commented 2 years ago

Fails:

% go version go version go1.18beta2 linux/amd64

As per:

https://go.dev/doc/devel/release#policy

Supported versions are today 1.16 and 1.17, so we can drop this brittle check.

magiconair commented 2 years ago

I know. A part of me somehow feels somewhat sentimental and proud of the fact that this library has been around since go1.3 (actually go1.2) and is still tested with that version - even though nobody uses it anymore.

go1.2: 2013-12-01 go1.3: 2014-06-18

=> 8 years... 😲

So other than that this test is a bit quirky does it hurt anybody to leave it in there for my own little personal satisfaction?

magiconair commented 2 years ago

But thank you @maage for caring enough about this! This means a lot to me.

magiconair commented 2 years ago

I could probably rewrite this test with a build constraint to make it more stable and keep the backwards testing.

maage commented 2 years ago

Something like this:

-               minor, _ = strconv.Atoi(ver[1])
+               wo_beta := strings.Split(ver[1], "beta")
+               minor, _ = strconv.Atoi(wo_beta[0])
magiconair commented 2 years ago

@maage would that work? Tested with go1.14.15, go1.17.7 and go1.18beta2

magiconair commented 2 years ago

Need to find the gpg key to sign this.