diff --git a/go.mod b/go.mod index 57f79dec0f3..bd7e5b346b1 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( google.golang.org/grpc v1.36.0 gopkg.in/go-playground/webhooks.v3 v3.13.0 gopkg.in/yaml.v2 v2.3.0 - knative.dev/hack v0.0.0-20230919151801-38316f28f0bf + knative.dev/hack v0.0.0-20230922134855-34850cddd60a ) require ( diff --git a/go.sum b/go.sum index e72b2378a7d..2a84ee86e66 100644 --- a/go.sum +++ b/go.sum @@ -207,7 +207,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -539,8 +539,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -knative.dev/hack v0.0.0-20230919151801-38316f28f0bf h1:Hyyc838y8572zTWTuL2ymWAiAhL2ujz7OLlB/KMtHF0= -knative.dev/hack v0.0.0-20230919151801-38316f28f0bf/go.mod h1:dx0YG3YWqJu653e9tjcT0Q1ZdS9JJXLKbUhzr4EB0g8= +knative.dev/hack v0.0.0-20230922134855-34850cddd60a h1:49UQAWesCa31hlEr+hJV1olDlK+ZhyYwI+KEFTgC8K8= +knative.dev/hack v0.0.0-20230922134855-34850cddd60a/go.mod h1:WA6zi0u24QTDuFZUeqBwSerEh4Io8lxe6UmvolOzA24= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/knative.dev/hack/go.work.sum b/vendor/knative.dev/hack/go.work.sum deleted file mode 100644 index d709822f8c2..00000000000 --- a/vendor/knative.dev/hack/go.work.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh index 40a95663e5a..770b249ec5d 100644 --- a/vendor/knative.dev/hack/library.sh +++ b/vendor/knative.dev/hack/library.sh @@ -672,7 +672,30 @@ function foreach_go_module() { # global env var: FLOATING_DEPS # --upgrade will set GOPROXY to direct unless it is already set. function go_update_deps() { + # The go.work.sum will be truncated if it exists. This is to allow the + # `go mod tidy` to resolve the dependencies, without the influence of the + # sums from the workspace. + __clean_goworksum_if_exists foreach_go_module __go_update_deps_for_module "$@" + __remove_goworksum_if_empty +} + +function __clean_goworksum_if_exists() { + if [ -f "$REPO_ROOT_DIR/go.work.sum" ]; then + echo "=== Cleaning the go.work.sum file" + true > "$REPO_ROOT_DIR/go.work.sum" + fi +} + +function __remove_goworksum_if_empty() { + if [ -f "$REPO_ROOT_DIR/go.work" ]; then + echo "=== Syncing the go workspace" + go work sync + fi + if ! [ -s "$REPO_ROOT_DIR/go.work.sum" ]; then + echo "=== Removing empty go.work.sum" + rm -f "$REPO_ROOT_DIR/go.work.sum" + fi } function __go_update_deps_for_module() { @@ -731,26 +754,22 @@ function __go_update_deps_for_module() { fi eval "$orig_pipefail_opt" - if ! [[ "${FORCE_VENDOR:-false}" == "true" ]] && ! [ -d vendor ]; then - return 0 - fi - - group "Removing unwanted vendor files" + if [[ "${FORCE_VENDOR:-false}" == "true" ]] || [ -d vendor ]; then + group "Removing unwanted vendor files" + find vendor/ \( -name "OWNERS" \ + -o -name "OWNERS_ALIASES" \ + -o -name "BUILD" \ + -o -name "BUILD.bazel" \ + -o -name "*_test.go" \) -exec rm -f {} + - # Remove unwanted vendor files - find vendor/ \( -name "OWNERS" \ - -o -name "OWNERS_ALIASES" \ - -o -name "BUILD" \ - -o -name "BUILD.bazel" \ - -o -name "*_test.go" \) -exec rm -f {} + + export GOFLAGS=-mod=vendor - export GOFLAGS=-mod=vendor + group "Removing broken symlinks" + remove_broken_symlinks ./vendor + fi group "Updating licenses" update_licenses third_party/VENDOR-LICENSE "./..." - - group "Removing broken symlinks" - remove_broken_symlinks ./vendor ) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 471b7261b60..3eabdd912d9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -298,7 +298,7 @@ gopkg.in/go-playground/webhooks.v3/github gopkg.in/yaml.v2 # honnef.co/go/tools v0.0.1-2020.1.5 ## explicit; go 1.11 -# knative.dev/hack v0.0.0-20230919151801-38316f28f0bf +# knative.dev/hack v0.0.0-20230922134855-34850cddd60a ## explicit; go 1.18 knative.dev/hack # go.opencensus.io => go.opencensus.io v0.20.2