From bd18618bf63bff56f62638cf1a29d7cc58108ae8 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 28 Apr 2022 09:51:03 +0000 Subject: [PATCH] tools: Move go.mod & go.sum files to root Go tooling does not work properly when modifying go files in subdirectories from the root of the IDE. Consolidate the two go modules in the source tree. We'll eventually want to move `src/dawn/node/tools` to `tools/src`. Allows us to type `go test ./...` at the root, and test all go code in the entire repo. Bug: dawn:1342 Change-Id: Ie3dd2c89a769cd25c2b68884970ef0f2ba8c7560 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86532 Commit-Queue: Ben Clayton Kokoro: Kokoro Reviewed-by: Corentin Wallez --- tools/src/go.mod => go.mod | 12 ++++++++---- tools/src/go.sum => go.sum | 2 ++ infra/kokoro/linux/docker.sh | 4 +--- src/dawn/node/tools/go.mod | 9 --------- src/dawn/node/tools/go.sum | 33 --------------------------------- third_party/go.mod | 1 + 6 files changed, 12 insertions(+), 49 deletions(-) rename tools/src/go.mod => go.mod (82%) rename tools/src/go.sum => go.sum (99%) delete mode 100644 src/dawn/node/tools/go.mod delete mode 100644 src/dawn/node/tools/go.sum create mode 100644 third_party/go.mod diff --git a/tools/src/go.mod b/go.mod similarity index 82% rename from tools/src/go.mod rename to go.mod index 6cc00c1e7e..76e87b76b3 100644 --- a/tools/src/go.mod +++ b/go.mod @@ -1,16 +1,20 @@ -module dawn.googlesource.com/dawn/tools/src +module dawn.googlesource.com/dawn go 1.18 require ( github.com/andygrunwald/go-gerrit v0.0.0-20220404064545-525eecd29744 + github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094 github.com/fatih/color v1.13.0 github.com/go-git/go-git/v5 v5.4.2 github.com/google/go-cmp v0.5.6 + github.com/mattn/go-colorable v0.1.9 + github.com/mattn/go-isatty v0.0.14 github.com/sergi/go-diff v1.2.0 github.com/shirou/gopsutil v3.21.11+incompatible go.chromium.org/luci v0.0.0-20220412023008-ab2409fe739a golang.org/x/net v0.0.0-20220403103023-749bd193bc2b + google.golang.org/protobuf v1.27.1 ) require ( @@ -25,9 +29,10 @@ require ( github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/klauspost/compress v1.13.5 // indirect - github.com/mattn/go-colorable v0.1.9 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect @@ -39,6 +44,5 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220216160803-4663080d8bc8 // indirect google.golang.org/grpc v1.44.0 // indirect - google.golang.org/protobuf v1.27.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/tools/src/go.sum b/go.sum similarity index 99% rename from tools/src/go.sum rename to go.sum index 8172f47c00..ddf815a9c9 100644 --- a/tools/src/go.sum +++ b/go.sum @@ -100,6 +100,8 @@ github.com/bazelbuild/buildtools v0.0.0-20210911013817-37179d5767a1/go.mod h1:68 github.com/bazelbuild/remote-apis v0.0.0-20210718193713-0ecef08215cf/go.mod h1:ry8Y6CkQqCVcYsjPOlLXDX2iRVjOnjogdNwhvHmRcz8= github.com/bazelbuild/remote-apis v0.0.0-20210812183132-3e816456ee28/go.mod h1:ry8Y6CkQqCVcYsjPOlLXDX2iRVjOnjogdNwhvHmRcz8= github.com/bazelbuild/remote-apis-sdks v0.0.0-20220301013006-36f659de32ef/go.mod h1:p6PH8Kyjfm/hhbwC8ymX8SarB7CQTUiW6J0T/zbEKj8= +github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094 h1:CTVJdI6oUCRNucMEmoh3c2U88DesoPtefsxKhoZ1WuQ= +github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094/go.mod h1:bV550SPlMos7UhMprxlm14XTBTpKHSUZ8Q4Id5qQuyw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= diff --git a/infra/kokoro/linux/docker.sh b/infra/kokoro/linux/docker.sh index 56f19c2a20..71d8269bb7 100755 --- a/infra/kokoro/linux/docker.sh +++ b/infra/kokoro/linux/docker.sh @@ -139,9 +139,7 @@ if [ "$BUILD_SYSTEM" == "cmake" ]; then status "Running go tool unittests" show_cmds - pushd tools/src - go test ./... - popd + go test ./... hide_cmds cd ${BUILD_DIR} diff --git a/src/dawn/node/tools/go.mod b/src/dawn/node/tools/go.mod deleted file mode 100644 index b5eb8dfb50..0000000000 --- a/src/dawn/node/tools/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module dawn.googlesource.com/dawn/src/dawn/node/tools - -go 1.16 - -require ( - github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094 - github.com/mattn/go-colorable v0.1.9 - github.com/mattn/go-isatty v0.0.14 // indirect -) diff --git a/src/dawn/node/tools/go.sum b/src/dawn/node/tools/go.sum deleted file mode 100644 index 42c01181c6..0000000000 --- a/src/dawn/node/tools/go.sum +++ /dev/null @@ -1,33 +0,0 @@ -github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094 h1:CTVJdI6oUCRNucMEmoh3c2U88DesoPtefsxKhoZ1WuQ= -github.com/ben-clayton/webidlparser v0.0.0-20210923100217-8ba896ded094/go.mod h1:bV550SPlMos7UhMprxlm14XTBTpKHSUZ8Q4Id5qQuyw= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -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-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/third_party/go.mod b/third_party/go.mod new file mode 100644 index 0000000000..fa8228e3af --- /dev/null +++ b/third_party/go.mod @@ -0,0 +1 @@ +// Empty go.mod file used to tell go not to scan this directory