mvdan / xurls

Extract urls from text
BSD 3-Clause "New" or "Revised" License
1.19k stars 116 forks source link

Fix install command to lack of v2 suffix and switch to mvdan way #35

Closed zchee closed 4 years ago

zchee commented 4 years ago

Add /v2 suffix for xurls command should fetch from the mvdan.cc/xurls/v2 module root. Actually, revert 795eb0c58b17f3db55c9b06d4a5bbc753199858a because the no longer supports Go version 1.11 and earlier on e21d637d7b83784a55a9ad577f035e72d72fa927. (Also said Requires Go 1.12 or later. on follows.)

Screen Shot 2019-12-27 at 9 31 04 PM

Also, like mvdan/gofumpt, switch to use mktmp way.

zchee commented 4 years ago

Hmm, but why still fetched mvdan.cc/xurls v1.1.0? Should I also revert follows means add canonical import comment?

$ go version
go version devel +4f75717954 Fri Dec 27 06:01:32 2019 +0000 darwin/amd64

$ cd $(mktemp -d); go mod init tmp; GO111MODULE=on go get mvdan.cc/xurls/v2/cmd/xurls

go: creating new go.mod: module tmp
go: downloading mvdan.cc/xurls v1.1.0  # this line
go: finding versions for mvdan.cc/xurls/v2/cmd/xurls
go: finding versions for mvdan.cc/xurls/v2/cmd
go: found mvdan.cc/xurls/v2/cmd/xurls in mvdan.cc/xurls/v2 v2.1.0

$ pwd
/var/folders/path/to/mktmp

$ cat go.mod
module tmp

go 1.14

require mvdan.cc/xurls/v2 v2.1.0 // indirect

$ cat go.sum
mvdan.cc/xurls v1.1.0 h1:kj0j2lonKseISJCiq1Tfk+iTv65dDGCl0rTbanXJGGc=
mvdan.cc/xurls/v2 v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
mvdan.cc/xurls/v2 v2.1.0/go.mod h1:5GrSd9rOnKOpZaji1OZLYL/yeAAtGDlo/cFe+8K5n8E=
mvdan commented 4 years ago

Hm. Not sure why it fetched v1 there. I don't have the time to investigate right now, but if you do, I'd be interested to see what you can find.

Thanks for the patch, in any case! Go 1.10 is indeed not relevant anymore.