From feebf74e97cb01ec01c8161ddc2dfee68f19d897 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Feb 2021 12:32:14 +0100 Subject: [PATCH 1/2] travis: run mage with -v to not discard output Before this: $ go run mage.go lint Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1 exit status 1 $ go run mage.go test Error: running "go test -race -v ./..." failed with exit code 1 exit status 1 After this: $ go run mage.go -v lint Running target: Lint exec: /Users/sebastiaan/go/bin/golangci-lint run ./... entry.go:89:6: `iamNotUsed` is unused (deadcode) func iamNotUsed() { ^ Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1 exit status 1 $ go run mage.go -v test Running target: Test exec: go test -race -v ./... === RUN TestRegister ... ? github.com/sirupsen/logrus/internal/testutils [no test files] FAIL Error: running "go test -race -v ./..." failed with exit code 1 exit status 1 Signed-off-by: Sebastiaan van Stijn --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6ee8b3ab..bb890a87e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,5 @@ install: - ./travis/install.sh script: - go run mage.go -v crossBuild - - go run mage.go lint - - go run mage.go test + - go run mage.go -v lint + - go run mage.go -v test From 1d8091a7e9eb9d08b8bfe15ba93cdf16c347e7a4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Feb 2021 12:44:32 +0100 Subject: [PATCH 2/2] move "mage" to a separate module Move the magefile related files to a submodule, so that it does not become a dependency for logrus itself. Signed-off-by: Sebastiaan van Stijn --- .travis.yml | 7 ++++--- ci/go.mod | 5 +++++ ci/go.sum | 2 ++ mage.go => ci/mage.go | 0 magefile.go => ci/magefile.go | 0 go.mod | 1 - go.sum | 4 ---- 7 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 ci/go.mod create mode 100644 ci/go.sum rename mage.go => ci/mage.go (100%) rename magefile.go => ci/magefile.go (100%) diff --git a/.travis.yml b/.travis.yml index bb890a87e..c1dbd5a3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ os: linux install: - ./travis/install.sh script: - - go run mage.go -v crossBuild - - go run mage.go -v lint - - go run mage.go -v test + - cd ci + - go run mage.go -v -w ../ crossBuild + - go run mage.go -v -w ../ lint + - go run mage.go -v -w ../ test diff --git a/ci/go.mod b/ci/go.mod new file mode 100644 index 000000000..e895e95a2 --- /dev/null +++ b/ci/go.mod @@ -0,0 +1,5 @@ +module github.com/sirupsen/logrus/ci + +go 1.15 + +require github.com/magefile/mage v1.11.0 diff --git a/ci/go.sum b/ci/go.sum new file mode 100644 index 000000000..edf273b8e --- /dev/null +++ b/ci/go.sum @@ -0,0 +1,2 @@ +github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls= +github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= diff --git a/mage.go b/ci/mage.go similarity index 100% rename from mage.go rename to ci/mage.go diff --git a/magefile.go b/ci/magefile.go similarity index 100% rename from magefile.go rename to ci/magefile.go diff --git a/go.mod b/go.mod index 37004ff34..b3919d5ea 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module github.com/sirupsen/logrus require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/magefile/mage v1.10.0 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 diff --git a/go.sum b/go.sum index bce26a188..694c18b84 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,8 @@ 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/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g= -github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= 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/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=