From 5fd3677e66a939d894be95a81bf8202fb0aa2f6a Mon Sep 17 00:00:00 2001 From: rvflash Date: Thu, 21 Nov 2024 13:47:40 +0100 Subject: [PATCH 1/3] adds support of multiple versions by package in the replace command --- .golangci.yml | 2 +- go.mod | 31 ++++- go.sum | 215 +++----------------------------- internal/app/app.go | 2 +- internal/semver/version.go | 19 +-- internal/vcs/git/vcs_test.go | 3 +- internal/vcs/goget/vcs_test.go | 3 +- pkg/goup/entry_internal_test.go | 3 +- pkg/goup/goup.go | 15 ++- pkg/goup/goup_internal_test.go | 5 +- pkg/mod/file.go | 4 +- pkg/mod/module.go | 14 +-- pkg/mod/module_internal_test.go | 28 ++--- testdata/mock/mod/file.go | 11 +- testdata/mock/mod/module.go | 24 ++-- testdata/mock/vcs/vcs.go | 21 ++-- 16 files changed, 134 insertions(+), 266 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f56cb98..7ebdb31 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ linters-settings: - standard - prefix(github.com) - prefix(golang.org) - - prefix(google.golang.org) + - prefix(go.uber.org/mock) linters: enable-all: true diff --git a/go.mod b/go.mod index 186988d..d6d13cc 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,39 @@ module github.com/rvflash/goup -go 1.14 +go 1.22 + +toolchain go1.23.1 require ( github.com/fatih/color v1.16.0 github.com/go-git/go-git/v5 v5.11.0 - github.com/golang/mock v1.7.0-rc.1 github.com/jdxcode/netrc v1.0.0 github.com/matryer/is v1.4.1 github.com/mattn/go-isatty v0.0.20 github.com/rvflash/workr v1.0.0 - golang.org/x/mod v0.14.0 + go.uber.org/mock v0.4.0 + golang.org/x/mod v0.18.0 +) + +require ( + dario.cat/mergo v1.0.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/cloudflare/circl v1.3.9 // indirect + github.com/cyphar/filepath-securejoin v0.2.5 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/sergi/go-diff v1.1.0 // indirect + github.com/skeema/knownhosts v1.2.2 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 4b22499..7f92f37 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= @@ -10,71 +10,35 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= +github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U= -github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jdxcode/netrc v1.0.0 h1:tJR3fyzTcjDi22t30pCdpOT8WJ5gb32zfYE1hFNCOjk= @@ -82,7 +46,6 @@ github.com/jdxcode/netrc v1.0.0/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lT github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -96,56 +59,15 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= -github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= -github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= -github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= -github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc= -github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= -github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= -github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= -github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= -github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= -github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= -github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= -github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= -github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= -github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= -github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= -github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= -github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rvflash/workr v1.0.0 h1:Fvjggx4VmCiCu0l4xdO1IVj0G75Oufel30JGds8MJLQ= @@ -153,137 +75,62 @@ github.com/rvflash/workr v1.0.0/go.mod h1:5T0C9utSdPnBWf4HOGO6Mbg1P1pRBlKsV7yjmj github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/arch v0.1.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -291,57 +138,23 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/app/app.go b/internal/app/app.go index 0207505..7bb66e6 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -175,7 +175,7 @@ func filePath(path string) string { func walkPath(root string) []string { var res []string - err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + err := filepath.Walk(root, func(path string, _ os.FileInfo, err error) error { if err != nil { return err } diff --git a/internal/semver/version.go b/internal/semver/version.go index 0304e00..24e4394 100644 --- a/internal/semver/version.go +++ b/internal/semver/version.go @@ -16,20 +16,25 @@ import ( type Tags []Tag // Not removes from the list of tags the given tag. -func (t Tags) Not(w fmt.Stringer) Tags { - key := func(t Tags) int { +func (t Tags) Not(versions ...fmt.Stringer) Tags { + key := func(t Tags, xv fmt.Stringer) int { for k, v := range t { - if Compare(v, w) == 0 { + if Compare(v, xv) == 0 { return k } } return -1 } - i := key(t) - if i < 0 { - return t + t2 := make([]Tag, len(t)) + copy(t2, t) + for _, xv := range versions { + i := key(t2, xv) + if i < 0 { + return t2 + } + t2 = append(t2[:i], t2[i+1:]...) } - return append(t[:i], t[i+1:]...) + return t2 } // Len implements the sort interface. diff --git a/internal/vcs/git/vcs_test.go b/internal/vcs/git/vcs_test.go index 854008c..3815973 100644 --- a/internal/vcs/git/vcs_test.go +++ b/internal/vcs/git/vcs_test.go @@ -10,12 +10,13 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/matryer/is" errup "github.com/rvflash/goup/internal/errors" "github.com/rvflash/goup/internal/vcs" "github.com/rvflash/goup/internal/vcs/git" mockvcs "github.com/rvflash/goup/testdata/mock/vcs" + + "go.uber.org/mock/gomock" ) const ( diff --git a/internal/vcs/goget/vcs_test.go b/internal/vcs/goget/vcs_test.go index c27e968..d28f9db 100644 --- a/internal/vcs/goget/vcs_test.go +++ b/internal/vcs/goget/vcs_test.go @@ -11,13 +11,14 @@ import ( "path/filepath" "testing" - "github.com/golang/mock/gomock" "github.com/matryer/is" "github.com/rvflash/goup/internal/errors" "github.com/rvflash/goup/internal/semver" "github.com/rvflash/goup/internal/vcs" "github.com/rvflash/goup/internal/vcs/goget" mockvcs "github.com/rvflash/goup/testdata/mock/vcs" + + "go.uber.org/mock/gomock" ) const ( diff --git a/pkg/goup/entry_internal_test.go b/pkg/goup/entry_internal_test.go index b95f5f7..3abd086 100644 --- a/pkg/goup/entry_internal_test.go +++ b/pkg/goup/entry_internal_test.go @@ -8,12 +8,13 @@ import ( "strings" "testing" - "github.com/golang/mock/gomock" "github.com/matryer/is" "github.com/rvflash/goup/internal/errors" "github.com/rvflash/goup/internal/semver" "github.com/rvflash/goup/pkg/mod" mockMod "github.com/rvflash/goup/testdata/mock/mod" + + "go.uber.org/mock/gomock" ) const ( diff --git a/pkg/goup/goup.go b/pkg/goup/goup.go index 194be60..60e2d02 100644 --- a/pkg/goup/goup.go +++ b/pkg/goup/goup.go @@ -8,6 +8,7 @@ package goup import ( "context" "errors" + "fmt" "io/ioutil" "sync/atomic" "time" @@ -150,9 +151,9 @@ func (e *goUp) checkDependency(ctx context.Context, dep mod.Module) *Entry { if err != nil { return newFailure(err, dep) } - x, ok := dep.ExcludeVersion() - if ok { - vs = vs.Not(x) + x := dep.ExcludeVersions() + if len(x) > 0 { + vs = vs.Not(stringer(x)...) } v, ok := latest(vs, dep, e.Config.Major, e.Config.MajorMinor) if !ok { @@ -170,6 +171,14 @@ func (e *goUp) checkDependency(ctx context.Context, dep mod.Module) *Entry { return newFailure(errs.ErrSystem, dep) } +func stringer(list []semver.Tag) []fmt.Stringer { + res := make([]fmt.Stringer, len(list)) + for k, v := range list { + res[k] = v + } + return res +} + func updateFile(file mod.Mod) error { buf, err := file.Format() if err != nil { diff --git a/pkg/goup/goup_internal_test.go b/pkg/goup/goup_internal_test.go index b7fd01c..a1be8ef 100644 --- a/pkg/goup/goup_internal_test.go +++ b/pkg/goup/goup_internal_test.go @@ -14,7 +14,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/matryer/is" errup "github.com/rvflash/goup/internal/errors" "github.com/rvflash/goup/internal/semver" @@ -22,6 +21,8 @@ import ( "github.com/rvflash/goup/pkg/mod" mockMod "github.com/rvflash/goup/testdata/mock/mod" mockVCS "github.com/rvflash/goup/testdata/mock/vcs" + + "go.uber.org/mock/gomock" ) func TestGoUp_CheckDependency(t *testing.T) { @@ -197,7 +198,7 @@ func newModule(ctrl *gomock.Controller, indirect bool) *mockMod.MockModule { m.EXPECT().Path().Return(repoName).AnyTimes() m.EXPECT().Version().Return(semver.New(v0)).AnyTimes() m.EXPECT().Indirect().Return(indirect).AnyTimes() - m.EXPECT().ExcludeVersion().Return(nil, false).AnyTimes() + m.EXPECT().ExcludeVersions().Return(nil).AnyTimes() return m } diff --git a/pkg/mod/file.go b/pkg/mod/file.go index 2c98f05..4f61b6f 100644 --- a/pkg/mod/file.go +++ b/pkg/mod/file.go @@ -150,7 +150,7 @@ func (f *File) Format() ([]byte, error) { // dependencies returns the list of modules in this go.mod file. // Firstly we get the modules used to replace legacy ones. -// Then those required. We use the replace dependency instead of this required. +// Then those required. We use the `replace` dependency instead of this required. func dependencies(f *modfile.File) []Module { var m = make(map[string]Module) for _, r := range f.Replace { @@ -184,7 +184,7 @@ func dependencies(f *modfile.File) []Module { // Ignores exclusion of any unused dependency. continue } - m[r.Mod.Path].(*module).excludeVersion = semver.New(r.Mod.Version) + m[r.Mod.Path].(*module).excludes = append(m[r.Mod.Path].(*module).excludes, semver.New(r.Mod.Version)) } return modules(m) } diff --git a/pkg/mod/module.go b/pkg/mod/module.go index a82d27d..12bac94 100644 --- a/pkg/mod/module.go +++ b/pkg/mod/module.go @@ -15,20 +15,20 @@ type Module interface { Path() string Replacement() bool Version() semver.Tag - ExcludeVersion() (v semver.Tag, ok bool) + ExcludeVersions() []semver.Tag } type module struct { indirect, replacement bool - path string - excludeVersion, - version *semver.Version + path string + excludes []semver.Tag + version *semver.Version } -// ExcludeVersion implements the module interface. -func (m *module) ExcludeVersion() (v semver.Tag, ok bool) { - return m.excludeVersion, m.excludeVersion != nil +// ExcludeVersions implements the module interface. +func (m *module) ExcludeVersions() []semver.Tag { + return m.excludes } // Indirect implements the module interface. diff --git a/pkg/mod/module_internal_test.go b/pkg/mod/module_internal_test.go index bd71d6c..eea4f16 100644 --- a/pkg/mod/module_internal_test.go +++ b/pkg/mod/module_internal_test.go @@ -26,13 +26,11 @@ func TestModule_Version(t *testing.T) { mod = module{} are = is.New(t) ) - are.Equal(mod.Indirect(), false) // mismatch indirect - are.Equal(mod.Path(), "") // mismatch path - are.True(!mod.Replacement()) // mismatch replacement - are.Equal(mod.Version(), nil) // mismatch version - x, ok := mod.ExcludeVersion() - are.True(!ok) // unexpected exclude version - are.Equal(x, nil) // mismatch exclude version + are.Equal(mod.Indirect(), false) // mismatch indirect + are.Equal(mod.Path(), "") // mismatch path + are.True(!mod.Replacement()) // mismatch replacement + are.Equal(mod.Version(), nil) // mismatch version + are.Equal(0, len(mod.ExcludeVersions())) // unexpected exclude version }) t.Run("valued", func(t *testing.T) { @@ -40,17 +38,17 @@ func TestModule_Version(t *testing.T) { var ( v = semver.New(version) mod = module{ - excludeVersion: v, - indirect: indirect, - path: path, - replacement: true, - version: v, + excludes: []semver.Tag{v}, + indirect: indirect, + path: path, + replacement: true, + version: v, } are = is.New(t) ) - x, ok := mod.ExcludeVersion() - are.True(ok) // expected exclude version - are.Equal(x, v) // mismatch exclude version + x := mod.ExcludeVersions() + are.Equal(1, len(x)) // expected exclude version + are.Equal(x[0], v) // mismatch exclude version are.Equal(mod.Indirect(), indirect) // mismatch indirect are.Equal(mod.Path(), path) // mismatch path are.True(mod.Replacement()) // mismatch replacement diff --git a/testdata/mock/mod/file.go b/testdata/mock/mod/file.go index 8e26426..95c1f19 100644 --- a/testdata/mock/mod/file.go +++ b/testdata/mock/mod/file.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: file.go +// +// Generated by this command: +// +// mockgen -destination ../../testdata/mock/mod/file.go -source file.go +// // Package mock_mod is a generated GoMock package. package mock_mod @@ -7,8 +12,8 @@ package mock_mod import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" mod "github.com/rvflash/goup/pkg/mod" + gomock "go.uber.org/mock/gomock" ) // MockMod is a mock of Mod interface. @@ -100,7 +105,7 @@ func (m *MockMod) UpdateReplace(oldPath, newVersion string) error { } // UpdateReplace indicates an expected call of UpdateReplace. -func (mr *MockModMockRecorder) UpdateReplace(oldPath, newVersion interface{}) *gomock.Call { +func (mr *MockModMockRecorder) UpdateReplace(oldPath, newVersion any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateReplace", reflect.TypeOf((*MockMod)(nil).UpdateReplace), oldPath, newVersion) } @@ -114,7 +119,7 @@ func (m *MockMod) UpdateRequire(path, version string) error { } // UpdateRequire indicates an expected call of UpdateRequire. -func (mr *MockModMockRecorder) UpdateRequire(path, version interface{}) *gomock.Call { +func (mr *MockModMockRecorder) UpdateRequire(path, version any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequire", reflect.TypeOf((*MockMod)(nil).UpdateRequire), path, version) } diff --git a/testdata/mock/mod/module.go b/testdata/mock/mod/module.go index 8c36ba9..8e10d1a 100644 --- a/testdata/mock/mod/module.go +++ b/testdata/mock/mod/module.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: module.go +// +// Generated by this command: +// +// mockgen -destination ../../testdata/mock/mod/module.go -source module.go +// // Package mock_mod is a generated GoMock package. package mock_mod @@ -7,8 +12,8 @@ package mock_mod import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" semver "github.com/rvflash/goup/internal/semver" + gomock "go.uber.org/mock/gomock" ) // MockModule is a mock of Module interface. @@ -34,19 +39,18 @@ func (m *MockModule) EXPECT() *MockModuleMockRecorder { return m.recorder } -// ExcludeVersion mocks base method. -func (m *MockModule) ExcludeVersion() (semver.Tag, bool) { +// ExcludeVersions mocks base method. +func (m *MockModule) ExcludeVersions() []semver.Tag { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExcludeVersion") - ret0, _ := ret[0].(semver.Tag) - ret1, _ := ret[1].(bool) - return ret0, ret1 + ret := m.ctrl.Call(m, "ExcludeVersions") + ret0, _ := ret[0].([]semver.Tag) + return ret0 } -// ExcludeVersion indicates an expected call of ExcludeVersion. -func (mr *MockModuleMockRecorder) ExcludeVersion() *gomock.Call { +// ExcludeVersions indicates an expected call of ExcludeVersions. +func (mr *MockModuleMockRecorder) ExcludeVersions() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExcludeVersion", reflect.TypeOf((*MockModule)(nil).ExcludeVersion)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExcludeVersions", reflect.TypeOf((*MockModule)(nil).ExcludeVersions)) } // Indirect mocks base method. diff --git a/testdata/mock/vcs/vcs.go b/testdata/mock/vcs/vcs.go index 811883d..79906c7 100644 --- a/testdata/mock/vcs/vcs.go +++ b/testdata/mock/vcs/vcs.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: vcs.go +// +// Generated by this command: +// +// mockgen -destination ../../testdata/mock/vcs/vcs.go -source vcs.go +// // Package mock_vcs is a generated GoMock package. package mock_vcs @@ -9,9 +14,9 @@ import ( http "net/http" reflect "reflect" - gomock "github.com/golang/mock/gomock" semver "github.com/rvflash/goup/internal/semver" vcs "github.com/rvflash/goup/internal/vcs" + gomock "go.uber.org/mock/gomock" ) // MockSystem is a mock of System interface. @@ -46,7 +51,7 @@ func (m *MockSystem) CanFetch(path string) bool { } // CanFetch indicates an expected call of CanFetch. -func (mr *MockSystemMockRecorder) CanFetch(path interface{}) *gomock.Call { +func (mr *MockSystemMockRecorder) CanFetch(path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanFetch", reflect.TypeOf((*MockSystem)(nil).CanFetch), path) } @@ -61,7 +66,7 @@ func (m *MockSystem) FetchPath(ctx context.Context, path string) (semver.Tags, e } // FetchPath indicates an expected call of FetchPath. -func (mr *MockSystemMockRecorder) FetchPath(ctx, path interface{}) *gomock.Call { +func (mr *MockSystemMockRecorder) FetchPath(ctx, path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchPath", reflect.TypeOf((*MockSystem)(nil).FetchPath), ctx, path) } @@ -76,7 +81,7 @@ func (m *MockSystem) FetchURL(ctx context.Context, url string) (semver.Tags, err } // FetchURL indicates an expected call of FetchURL. -func (mr *MockSystemMockRecorder) FetchURL(ctx, url interface{}) *gomock.Call { +func (mr *MockSystemMockRecorder) FetchURL(ctx, url any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchURL", reflect.TypeOf((*MockSystem)(nil).FetchURL), ctx, url) } @@ -113,7 +118,7 @@ func (m *MockBasicAuthentifier) BasicAuth(host string) *vcs.BasicAuth { } // BasicAuth indicates an expected call of BasicAuth. -func (mr *MockBasicAuthentifierMockRecorder) BasicAuth(host interface{}) *gomock.Call { +func (mr *MockBasicAuthentifierMockRecorder) BasicAuth(host any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BasicAuth", reflect.TypeOf((*MockBasicAuthentifier)(nil).BasicAuth), host) } @@ -151,7 +156,7 @@ func (m *MockClient) Do(req *http.Request) (*http.Response, error) { } // Do indicates an expected call of Do. -func (mr *MockClientMockRecorder) Do(req interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) Do(req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockClient)(nil).Do), req) } @@ -188,7 +193,7 @@ func (m *MockClientChooser) AllowInsecure(path string) bool { } // AllowInsecure indicates an expected call of AllowInsecure. -func (mr *MockClientChooserMockRecorder) AllowInsecure(path interface{}) *gomock.Call { +func (mr *MockClientChooserMockRecorder) AllowInsecure(path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllowInsecure", reflect.TypeOf((*MockClientChooser)(nil).AllowInsecure), path) } @@ -202,7 +207,7 @@ func (m *MockClientChooser) ClientFor(path string) vcs.Client { } // ClientFor indicates an expected call of ClientFor. -func (mr *MockClientChooserMockRecorder) ClientFor(path interface{}) *gomock.Call { +func (mr *MockClientChooserMockRecorder) ClientFor(path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFor", reflect.TypeOf((*MockClientChooser)(nil).ClientFor), path) } From 256717e4cadb5d22a544ba9c573cf8b55e832d57 Mon Sep 17 00:00:00 2001 From: rvflash Date: Thu, 21 Nov 2024 15:11:08 +0100 Subject: [PATCH 2/3] adds support of multiple versions by package in the replace command: go lint --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 86 ++++------------------------- internal/app/app_test.go | 2 +- internal/log/logger.go | 2 +- internal/log/logger_test.go | 5 +- internal/vcs/git/vcs_test.go | 4 +- internal/vcs/goget/vcs_test.go | 6 +- pkg/goup/entry_internal_test.go | 4 +- pkg/goup/goup.go | 4 +- pkg/goup/goup_internal_test.go | 13 ++--- pkg/mod/file.go | 3 +- pkg/mod/file_test.go | 11 ++-- 12 files changed, 38 insertions(+), 104 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9bd1292..6dc625d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,7 +16,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.54.2 + version: v1.61.0 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/.golangci.yml b/.golangci.yml index 7ebdb31..bda6cb2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,77 +7,15 @@ linters-settings: - prefix(go.uber.org/mock) linters: - enable-all: true - disable: - - wsl - - godox - - gomnd - - varnamelen - - wrapcheck - - nonamedreturns - - nlreturn - - goerr113 - - ireturn - - exhaustive - - exhaustivestruct - - exhaustruct - - cyclop - - gofumpt - - depguard - -issues: - exclude-use-default: false - exclude-rules: - - path: _test\.go - linters: - - gomnd - - gochecknoglobals - - funlen - - dupl - - gosec - - noctx - - forcetypeassert - - containedctx - - - path: main\.go - text: "^buildVersion is a global variable" - linters: - - gochecknoglobals - - path: pkg/mod/file\.go - text: "G304: Potential file inclusion via variable" - linters: - - gosec - - path: pkg/mod/file\.go - text: "type assertion must be checked" - linters: - - forcetypeassert - - path: pkg/mod/file\.go - tex: "non-wrapping format verb for fmt.Errorf" - linters: - - errorlint - - path: internal/app/app_test\.go - text: "SA1012: do not pass a nil Context" - linters: - - staticcheck - - path: internal/vcs/http\.go - text: "G402: TLS InsecureSkipVerify set true." - linters: - - gosec - - linters: - - tparallel - text: "subtests should call t.Parallel" - - path: vcs_test\.go - linters: - - paralleltest - - path: pkg/goup/* - linters: - - paralleltest - - - linters: - - lll - source: "^//go:generate " - - # temporary "fix" waiting for https://github.com/kunwardeep/paralleltest/issues/14. - - linters: - - paralleltest - text: "does not use range value in test Run" \ No newline at end of file + enable: + # Enabled by Default. + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused + # Carians requirements + - gci + - revive \ No newline at end of file diff --git a/internal/app/app_test.go b/internal/app/app_test.go index f03fdc3..ff5c102 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -125,7 +125,7 @@ func TestApp_Check(t *testing.T) { } }() var a app.App - is.New(t).True(a.Check(nil, nil)) + is.New(t).True(a.Check(context.TODO(), nil)) } func TestWithChecker(t *testing.T) { diff --git a/internal/log/logger.go b/internal/log/logger.go index 8b6c4f6..06f47ee 100644 --- a/internal/log/logger.go +++ b/internal/log/logger.go @@ -91,7 +91,7 @@ func (l *Logger) printf(format string, color func(a ...interface{}) string, args } if len(args) == 0 { // No argument, the entire message is colored - l.stderr.Printf(color(format)) + l.stderr.Print(color(format)) return } l.stderr.Printf(format, colors(color, args)...) diff --git a/internal/log/logger_test.go b/internal/log/logger_test.go index b14c2e6..639a543 100644 --- a/internal/log/logger_test.go +++ b/internal/log/logger_test.go @@ -5,7 +5,6 @@ package log_test import ( - "io/ioutil" "os" "testing" @@ -142,7 +141,7 @@ func callf(t *testing.T, w log.Printer, method string, format string, args ...in func readFile(t *testing.T, f *os.File) (string, int) { t.Helper() - buf, err := ioutil.ReadFile(f.Name()) + buf, err := os.ReadFile(f.Name()) if err != nil { t.Error(err) return "", 0 @@ -152,7 +151,7 @@ func readFile(t *testing.T, f *os.File) (string, int) { func newFile(t *testing.T) (*os.File, func() error) { t.Helper() - f, err := ioutil.TempFile("", log.Prefix) + f, err := os.CreateTemp("", log.Prefix) if err != nil { t.Fatal(err) } diff --git a/internal/vcs/git/vcs_test.go b/internal/vcs/git/vcs_test.go index 3815973..559dfcf 100644 --- a/internal/vcs/git/vcs_test.go +++ b/internal/vcs/git/vcs_test.go @@ -71,7 +71,7 @@ func TestVCS_FetchPath(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { s := git.New(tt.cli, tt.auth) _, err := s.FetchPath(tt.ctx, tt.in) are.True(errors.Is(err, tt.err)) // mismatch error @@ -125,7 +125,7 @@ func TestVCS_FetchURL(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { s := git.New(tt.cli, tt.auth) _, err := s.FetchURL(tt.ctx, tt.in) are.True(errors.Is(err, tt.err)) // mismatch error diff --git a/internal/vcs/goget/vcs_test.go b/internal/vcs/goget/vcs_test.go index d28f9db..de37dfc 100644 --- a/internal/vcs/goget/vcs_test.go +++ b/internal/vcs/goget/vcs_test.go @@ -48,7 +48,7 @@ func TestVCS_CanFetch(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { s := goget.New(mockvcs.NewMockClientChooser(ctrl), mockvcs.NewMockSystem(ctrl)) are.Equal(s.CanFetch(tt.in), tt.out) // mismatch fetch }) @@ -94,7 +94,7 @@ func TestVCS_FetchPath(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { s := goget.New(tt.cli, tt.git) res, err := s.FetchPath(tt.ctx, tt.path) are.Equal(err, tt.err) // mismatch error @@ -155,7 +155,7 @@ func TestVCS_FetchURL(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { s := goget.New(tt.cli, tt.git) res, err := s.FetchURL(tt.ctx, tt.uri) are.Equal(err, tt.err) // mismatch error diff --git a/pkg/goup/entry_internal_test.go b/pkg/goup/entry_internal_test.go index 3abd086..4c10db6 100644 --- a/pkg/goup/entry_internal_test.go +++ b/pkg/goup/entry_internal_test.go @@ -85,7 +85,7 @@ func TestNewError(t *testing.T) { for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { msg := newError(tt.err, tt.file) are.Equal(msg.Level(), ErrorLevel) // mismatch level are.True(strings.Contains(msg.Format(), tt.msg)) // mismatch message @@ -124,7 +124,7 @@ func TestNewFailure(t *testing.T) { for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { msg := newFailure(tt.err, tt.dep) are.Equal(msg.Level(), ErrorLevel) // mismatch level are.True(strings.Contains(msg.Format(), tt.msg)) // mismatch message diff --git a/pkg/goup/goup.go b/pkg/goup/goup.go index 60e2d02..c89779b 100644 --- a/pkg/goup/goup.go +++ b/pkg/goup/goup.go @@ -9,7 +9,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "os" "sync/atomic" "time" @@ -187,7 +187,7 @@ func updateFile(file mod.Mod) error { } return nil } - return ioutil.WriteFile(file.Name(), buf, perm) + return os.WriteFile(file.Name(), buf, perm) } func (e *goUp) ready(ctx context.Context) bool { diff --git a/pkg/goup/goup_internal_test.go b/pkg/goup/goup_internal_test.go index a1be8ef..b260dfc 100644 --- a/pkg/goup/goup_internal_test.go +++ b/pkg/goup/goup_internal_test.go @@ -7,7 +7,6 @@ package goup import ( "context" "errors" - "io/ioutil" "os" "path/filepath" "strings" @@ -69,7 +68,7 @@ func TestGoUp_CheckDependency(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { u := newGoUp(tt.cnf, setGoGet(tt.system), setGit(tt.system)) e := u.checkDependency(tt.ctx, tt.module) are.Equal(tt.level, e.Level()) // mismatch level @@ -84,7 +83,7 @@ func TestUpdateFile(t *testing.T) { defer ctrl.Finish() are := is.New(t) - dir, err := ioutil.TempDir("", "goup") + dir, err := os.MkdirTemp("", "goup") defer func() { _ = os.RemoveAll(dir) }() @@ -101,8 +100,8 @@ func TestUpdateFile(t *testing.T) { } for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { - err := updateFile(tt.file) + t.Run(name, func(_ *testing.T) { + err = updateFile(tt.file) are.True(errors.Is(err, tt.err)) // mismatch error are.Equal(tt.updated, fileExists(tt.file.Name())) // mismatch file "created" }) @@ -149,7 +148,7 @@ func TestLatest(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(_ *testing.T) { out, ok := latest(tt.in, tt.dep, tt.cnf.Major, tt.cnf.MajorMinor) are.Equal(out, tt.out) // mismatch tag are.Equal(ok, tt.ok) // mismatch found @@ -186,7 +185,7 @@ func TestOnlyTag(t *testing.T) { ) for name, ts := range dt { tt := ts - t.Run(name, func(t *testing.T) { + t.Run(name, func(*testing.T) { err := onlyTag(tt.dep, tt.paths) are.Equal(err, tt.err) // mismatch error }) diff --git a/pkg/mod/file.go b/pkg/mod/file.go index 4f61b6f..49224f1 100644 --- a/pkg/mod/file.go +++ b/pkg/mod/file.go @@ -6,7 +6,6 @@ package mod import ( "fmt" - "io/ioutil" "os" "path/filepath" "sync" @@ -46,7 +45,7 @@ func Parse(path string) (*File, error) { if filepath.Base(path) != Filename { return nil, errors.ErrMod } - b, err := ioutil.ReadFile(path) + b, err := os.ReadFile(path) if err != nil { return nil, fmt.Errorf("%w: %s", errors.ErrMod, err.Error()) } diff --git a/pkg/mod/file_test.go b/pkg/mod/file_test.go index 304fa99..a79aaf8 100644 --- a/pkg/mod/file_test.go +++ b/pkg/mod/file_test.go @@ -7,7 +7,6 @@ package mod_test import ( "bytes" "errors" - "io/ioutil" "log" "os" "path/filepath" @@ -57,14 +56,14 @@ func TestFile_Format(t *testing.T) { are.NoErr(err) // parse error buf, err := out.Format() are.True(errors.Is(err, errup.ErrNotModified)) - got, err := ioutil.ReadFile(name) + got, err := os.ReadFile(name) are.NoErr(err) // expected source file are.Equal(buf, normalizeNewlines(got)) // expected no change are.NoErr(out.UpdateReplace(d0, v0)) // update replace are.NoErr(out.UpdateRequire(d1, v1)) // update require got, err = out.Format() are.NoErr(err) // writing failed - exp, err := ioutil.ReadFile(filepath.Join(updatedGoMod...)) + exp, err := os.ReadFile(filepath.Join(updatedGoMod...)) are.NoErr(err) // missing expecting are.Equal(normalizeNewlines(got), normalizeNewlines(exp)) // mismatch data } @@ -137,16 +136,16 @@ func TestOpen(t *testing.T) { func newTmpGoMod(t *testing.T) (name string, cleanup func()) { t.Helper() - dir, err := ioutil.TempDir("", "goup") + dir, err := os.MkdirTemp("", "goup") if err != nil { t.Fatal(err) } - buf, err := ioutil.ReadFile(filepath.Join(updateGoMod...)) + buf, err := os.ReadFile(filepath.Join(updateGoMod...)) if err != nil { log.Fatal(err) } name = filepath.Join(dir, "go.mod") - err = ioutil.WriteFile(name, buf, 0644) + err = os.WriteFile(name, buf, 0644) if err != nil { log.Fatal(err) } From 9e89a3a544e5622da2e1de9ae66f3d409c9d2a57 Mon Sep 17 00:00:00 2001 From: rvflash Date: Thu, 21 Nov 2024 15:18:02 +0100 Subject: [PATCH 3/3] adds support of multiple versions by package in the replace command: go lint --- .github/workflows/go-build.yml | 4 ++-- .golangci.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-build.yml b/.github/workflows/go-build.yml index 34cf63e..fe8ceaa 100644 --- a/.github/workflows/go-build.yml +++ b/.github/workflows/go-build.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 2 - uses: actions/setup-go@v3 with: - go-version: '1.21' + go-version: '1.23' - name: Run coverage run: go test -race -coverprofile=coverage.out -covermode=atomic ./... - name: Upload coverage to Codecov @@ -26,7 +26,7 @@ jobs: test: strategy: matrix: - go-version: [1.20.x, 1.21.x] + go-version: [1.22.x, 1.23.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/.golangci.yml b/.golangci.yml index bda6cb2..1ad9eb6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,6 @@ linters: - staticcheck - typecheck - unused - # Carians requirements + # Other requirements - gci - revive \ No newline at end of file