diff --git a/dist/Go Module/Makefile b/dist/Go Module/Makefile index b2eabbc..7844273 100644 --- a/dist/Go Module/Makefile +++ b/dist/Go Module/Makefile @@ -153,12 +153,15 @@ deps-tidy: deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' deps-update: $(AT) if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ - packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \ + packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ - if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \ - for package in $$packages; do go get -d $$package; done + if [ -z "$$packages" ]; then exit; fi; \ + for package in $$packages; do \ + go mod edit -require=$$package@latest; \ + go mod tidy; \ + done $(AT) $(MAKE) deps-tidy .PHONY: deps-update @@ -275,7 +278,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' tools-update: $(AT) cd tools; \ if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ diff --git a/dist/Go Service/Makefile b/dist/Go Service/Makefile index d461987..4107324 100644 --- a/dist/Go Service/Makefile +++ b/dist/Go Service/Makefile @@ -152,12 +152,15 @@ deps-tidy: deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' deps-update: $(AT) if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ - packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \ + packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ - if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \ - for package in $$packages; do go get -d $$package; done + if [ -z "$$packages" ]; then exit; fi; \ + for package in $$packages; do \ + go mod edit -require=$$package@latest; \ + go mod tidy; \ + done $(AT) $(MAKE) deps-tidy .PHONY: deps-update @@ -338,7 +341,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' tools-update: $(AT) cd tools; \ if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ diff --git a/dist/Go Tool/Makefile b/dist/Go Tool/Makefile index a612884..78773c1 100644 --- a/dist/Go Tool/Makefile +++ b/dist/Go Tool/Makefile @@ -152,12 +152,15 @@ deps-tidy: deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' deps-update: $(AT) if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ - packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \ + packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ - if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \ - for package in $$packages; do go get -d $$package; done + if [ -z "$$packages" ]; then exit; fi; \ + for package in $$packages; do \ + go mod edit -require=$$package@latest; \ + go mod tidy; \ + done $(AT) $(MAKE) deps-tidy .PHONY: deps-update @@ -323,7 +326,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' tools-update: $(AT) cd tools; \ if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ diff --git a/src/go/deps.mk b/src/go/deps.mk index b702403..8c1066a 100644 --- a/src/go/deps.mk +++ b/src/go/deps.mk @@ -23,11 +23,14 @@ deps-tidy: deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' deps-update: $(AT) if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ - packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \ + packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \ - if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \ - for package in $$packages; do go get -d $$package; done + if [ -z "$$packages" ]; then exit; fi; \ + for package in $$packages; do \ + go mod edit -require=$$package@latest; \ + go mod tidy; \ + done $(AT) $(MAKE) deps-tidy .PHONY: deps-update diff --git a/src/go/tools.mk b/src/go/tools.mk index 47b62db..75d1d7c 100644 --- a/src/go/tools.mk +++ b/src/go/tools.mk @@ -32,7 +32,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' tools-update: $(AT) cd tools; \ if command -v egg >/dev/null; then \ - packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \ + packages="`egg deps list | tr ' ' '\n'`"; \ else \ packages="`go list -f $(selector) -m -mod=readonly all`"; \ fi; \