anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.51k stars 622 forks source link

remove golang.org/x/exp since it doesn't follow go 1 compatibility promise #957

Closed trim21 closed 3 days ago

trim21 commented 3 months ago

document says golang.org/x/exp doesn't follow go 1 compatibility promise, so copy the package we used to internal for future compatibility promise.

In the future if downsteam user import exp with a newer non-compatibility version it will get unexpected surprise.

it's still a indirect dependency from github.com/anacrolix/generics, so I suggest to remove it from github.com/anacrolix/generics too

anacrolix commented 3 months ago

I'm really not that worried about it. If exp removes the APIs, it still won't break people unless they're aggressively updating their transitive dependencies (a common anti-pattern in Go, go get -u specifically).

That said, the Go team has been known to remove APIs for pedantic reasons, but it's still not that worrying.

trim21 commented 3 months ago

downstream users may rely on another package non-compatibility exp versions in the future

trim21 commented 2 months ago

go1.23 will add these 2 functions to stdlib

anacrolix commented 2 months ago

Awesome, feel free to make a PR to use the functions from the standard library

anacrolix commented 3 days ago

I fixed this in master, thanks!