1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-15 01:34:21 +02:00

chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0 (#1563)

* chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2020-05-26 00:48:10 -03:00
committed by GitHub
parent 501f092811
commit 69c8a502db
55 changed files with 341 additions and 316 deletions

View File

@ -14,3 +14,4 @@ linters:
- godox - godox
- gomnd - gomnd
- gocognit - gocognit
- goerr113

2
go.mod
View File

@ -11,7 +11,7 @@ require (
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e
github.com/client9/misspell v0.3.4 github.com/client9/misspell v0.3.4
github.com/fatih/color v1.9.0 github.com/fatih/color v1.9.0
github.com/golangci/golangci-lint v1.23.7 github.com/golangci/golangci-lint v1.27.0
github.com/google/go-github/v28 v28.1.1 github.com/google/go-github/v28 v28.1.1
github.com/goreleaser/nfpm v1.2.1 github.com/goreleaser/nfpm v1.2.1
github.com/imdario/mergo v0.3.9 github.com/imdario/mergo v0.3.9

86
go.sum
View File

@ -29,6 +29,8 @@ github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSW
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157 h1:hY39LwQHh+1kaovmIjOrlqnXNX6tygSRfLkkK33IkZU=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk= github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
@ -59,8 +61,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/bombsimon/wsl/v2 v2.0.0 h1:+Vjcn+/T5lSrO8Bjzhk4v14Un/2UyCA1E3V5j9nwTkQ= github.com/bombsimon/wsl/v3 v3.0.0 h1:w9f49xQatuaeTJFaNP4SpiWSR5vfT6IstPtM62JjcqA=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/caarlos0/ctrlc v1.0.0 h1:2DtF8GSIcajgffDFJzyG15vO+1PuBWOMUdFut7NnXhw= github.com/caarlos0/ctrlc v1.0.0 h1:2DtF8GSIcajgffDFJzyG15vO+1PuBWOMUdFut7NnXhw=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e h1:V9a67dfYqPLAvzk5hMQOXYJlZ4SLIXgyKIE+ZiHzgGQ= github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e h1:V9a67dfYqPLAvzk5hMQOXYJlZ4SLIXgyKIE+ZiHzgGQ=
@ -80,7 +82,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -131,6 +133,7 @@ github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUD
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA= github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b h1:ekuhfTjngPhisSjOJ0QWKpPQE8/rbknHaes6WVJj5Hw= github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b h1:ekuhfTjngPhisSjOJ0QWKpPQE8/rbknHaes6WVJj5Hw=
@ -164,8 +167,8 @@ github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70u
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7 h1:/rWK6IXb9k554NPStxDapUgHsJhKf73AsSWvYqIDkp8= github.com/golangci/golangci-lint v1.27.0 h1:VYLx63qb+XJsHdZ27PMS2w5JZacN0XG8ffUwe7yQomo=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ= github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI= github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA=
@ -213,6 +216,7 @@ github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/nfpm v1.2.1 h1:AEnu9XVmupRDTR930Z2rAs31Mj6sLIPxFcR9ESYvgDA= github.com/goreleaser/nfpm v1.2.1 h1:AEnu9XVmupRDTR930Z2rAs31Mj6sLIPxFcR9ESYvgDA=
@ -275,16 +279,18 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 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/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKoALdbQ=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
@ -310,22 +316,28 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nakabonne/nestif v0.3.0 h1:+yOViDGhg8ygGrmII72nV9B/zGxY188TYpfolntsaPw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E= github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@ -347,10 +359,12 @@ github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4 h1:oCreMAt9GuFXDe9jW4HBpc3GjdX3R/sUEcLAGh1zPx8=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b h1:+gCnWOZV8Z/8jehJ2CdqB47Z3S+SREmQcuXkRFLNsiI= github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b h1:+gCnWOZV8Z/8jehJ2CdqB47Z3S+SREmQcuXkRFLNsiI=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83 h1:AtnWoOvTioyDXFvu96MWEeE8qj4COSQnJogzLy/u41A= github.com/securego/gosec/v2 v2.3.0 h1:y/9mCF2WPDbSDpL3QDWZD3HHGrSYw0QSHnCqTfs4JPE=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE= github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
@ -400,6 +414,10 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7 h1:+mecr7RKrUKB5UQ1gwqEMn13sDKTyDR8KNIquB9mm+8=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0 h1:Rw8kxzWo1mr6FSaYXjQELRe88y2KdfynXdnK72rdjtA= github.com/tj/assert v0.0.0-20171129193455-018094318fb0 h1:Rw8kxzWo1mr6FSaYXjQELRe88y2KdfynXdnK72rdjtA=
@ -408,8 +426,8 @@ github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eN
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1 h1:4D0wuPKjOTiK2garzuPGGvm4zZ/wLYDOH8TJSABC7KU= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa h1:RC4maTWLKKwb7p1cnoygsbKIgNlJqSYBeAFON3Ar8As=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
@ -431,6 +449,8 @@ github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofm
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
@ -461,8 +481,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -481,8 +501,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -513,9 +533,10 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/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 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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 h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
@ -543,18 +564,23 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3 h1:Ms82wn6YK4ZycO6Bxyh0kxX3gFFVGo79CCuc52xgcys= golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770 h1:M9Fif0OxNji8w+HvmhVQ8KJtiZOsjU9RgslJGhn95XE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
@ -589,6 +615,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/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-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
@ -601,16 +629,14 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo=

View File

@ -1,4 +1,4 @@
// Package artifact provides the core artifact storage for goreleaser // Package artifact provides the core artifact storage for goreleaser.
package artifact package artifact
// nolint: gosec // nolint: gosec
@ -19,7 +19,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Type defines the type of an artifact // Type defines the type of an artifact.
type Type int type Type int
const ( const (
@ -76,7 +76,7 @@ func (t Type) String() string {
return "unknown" return "unknown"
} }
// Artifact represents an artifact and its relevant info // Artifact represents an artifact and its relevant info.
type Artifact struct { type Artifact struct {
Name string Name string
Path string Path string
@ -105,7 +105,7 @@ func (a Artifact) Checksum(algorithm string) (string, error) {
if err != nil { if err != nil {
return "", errors.Wrap(err, "failed to checksum") return "", errors.Wrap(err, "failed to checksum")
} }
defer file.Close() // nolint: errcheck defer file.Close()
var h hash.Hash var h hash.Hash
switch algorithm { switch algorithm {
case "crc32": case "crc32":
@ -132,13 +132,13 @@ func (a Artifact) Checksum(algorithm string) (string, error) {
return hex.EncodeToString(h.Sum(nil)), nil return hex.EncodeToString(h.Sum(nil)), nil
} }
// Artifacts is a list of artifacts // Artifacts is a list of artifacts.
type Artifacts struct { type Artifacts struct {
items []*Artifact items []*Artifact
lock *sync.Mutex lock *sync.Mutex
} }
// New return a new list of artifacts // New return a new list of artifacts.
func New() Artifacts { func New() Artifacts {
return Artifacts{ return Artifacts{
items: []*Artifact{}, items: []*Artifact{},
@ -146,12 +146,12 @@ func New() Artifacts {
} }
} }
// List return the actual list of artifacts // List return the actual list of artifacts.
func (artifacts Artifacts) List() []*Artifact { func (artifacts Artifacts) List() []*Artifact {
return artifacts.items return artifacts.items
} }
// GroupByPlatform groups the artifacts by their platform // GroupByPlatform groups the artifacts by their platform.
func (artifacts Artifacts) GroupByPlatform() map[string][]*Artifact { func (artifacts Artifacts) GroupByPlatform() map[string][]*Artifact {
var result = map[string][]*Artifact{} var result = map[string][]*Artifact{}
for _, a := range artifacts.items { for _, a := range artifacts.items {
@ -161,7 +161,7 @@ func (artifacts Artifacts) GroupByPlatform() map[string][]*Artifact {
return result return result
} }
// Add safely adds a new artifact to an artifact list // Add safely adds a new artifact to an artifact list.
func (artifacts *Artifacts) Add(a *Artifact) { func (artifacts *Artifacts) Add(a *Artifact) {
artifacts.lock.Lock() artifacts.lock.Lock()
defer artifacts.lock.Unlock() defer artifacts.lock.Unlock()
@ -174,31 +174,31 @@ func (artifacts *Artifacts) Add(a *Artifact) {
} }
// Filter defines an artifact filter which can be used within the Filter // Filter defines an artifact filter which can be used within the Filter
// function // function.
type Filter func(a *Artifact) bool type Filter func(a *Artifact) bool
// ByGoos is a predefined filter that filters by the given goos // ByGoos is a predefined filter that filters by the given goos.
func ByGoos(s string) Filter { func ByGoos(s string) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
return a.Goos == s return a.Goos == s
} }
} }
// ByGoarch is a predefined filter that filters by the given goarch // ByGoarch is a predefined filter that filters by the given goarch.
func ByGoarch(s string) Filter { func ByGoarch(s string) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
return a.Goarch == s return a.Goarch == s
} }
} }
// ByGoarm is a predefined filter that filters by the given goarm // ByGoarm is a predefined filter that filters by the given goarm.
func ByGoarm(s string) Filter { func ByGoarm(s string) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
return a.Goarm == s return a.Goarm == s
} }
} }
// ByType is a predefined filter that filters by the given type // ByType is a predefined filter that filters by the given type.
func ByType(t Type) Filter { func ByType(t Type) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
return a.Type == t return a.Type == t
@ -232,7 +232,7 @@ func ByIDs(ids ...string) Filter {
return Or(filters...) return Or(filters...)
} }
// Or performs an OR between all given filters // Or performs an OR between all given filters.
func Or(filters ...Filter) Filter { func Or(filters ...Filter) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
for _, f := range filters { for _, f := range filters {
@ -244,7 +244,7 @@ func Or(filters ...Filter) Filter {
} }
} }
// And performs an AND between all given filters // And performs an AND between all given filters.
func And(filters ...Filter) Filter { func And(filters ...Filter) Filter {
return func(a *Artifact) bool { return func(a *Artifact) bool {
for _, f := range filters { for _, f := range filters {

View File

@ -19,7 +19,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Default builder instance // Default builder instance.
// nolint: gochecknoglobals // nolint: gochecknoglobals
var Default = &Builder{} var Default = &Builder{}
@ -28,10 +28,10 @@ func init() {
api.Register("go", Default) api.Register("go", Default)
} }
// Builder is golang builder // Builder is golang builder.
type Builder struct{} type Builder struct{}
// WithDefaults sets the defaults for a golang build and returns it // WithDefaults sets the defaults for a golang build and returns it.
func (*Builder) WithDefaults(build config.Build) config.Build { func (*Builder) WithDefaults(build config.Build) config.Build {
if build.Dir == "" { if build.Dir == "" {
build.Dir = "." build.Dir = "."
@ -57,7 +57,7 @@ func (*Builder) WithDefaults(build config.Build) config.Build {
return build return build
} }
// Build builds a golang build // Build builds a golang build.
func (*Builder) Build(ctx *context.Context, build config.Build, options api.Options) error { func (*Builder) Build(ctx *context.Context, build config.Build, options api.Options) error {
if err := checkMain(build); err != nil { if err := checkMain(build); err != nil {
return err return err

View File

@ -10,21 +10,21 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Info of the repository // Info of the repository.
type Info struct { type Info struct {
Description string Description string
Homepage string Homepage string
URL string URL string
} }
// Client interface // Client interface.
type Client interface { type Client interface {
CreateRelease(ctx *context.Context, body string) (releaseID string, err error) CreateRelease(ctx *context.Context, body string) (releaseID string, err error)
CreateFile(ctx *context.Context, commitAuthor config.CommitAuthor, repo config.Repo, content []byte, path, message string) (err error) CreateFile(ctx *context.Context, commitAuthor config.CommitAuthor, repo config.Repo, content []byte, path, message string) (err error)
Upload(ctx *context.Context, releaseID string, artifact *artifact.Artifact, file *os.File) (err error) Upload(ctx *context.Context, releaseID string, artifact *artifact.Artifact, file *os.File) (err error)
} }
// New creates a new client depending on the token type // New creates a new client depending on the token type.
func New(ctx *context.Context) (Client, error) { func New(ctx *context.Context) (Client, error) {
log.WithField("type", ctx.TokenType).Info("token type") log.WithField("type", ctx.TokenType).Info("token type")
if ctx.TokenType == context.TokenTypeGitHub { if ctx.TokenType == context.TokenTypeGitHub {

View File

@ -33,7 +33,7 @@ func getInstanceURL(apiURL string) (string, error) {
return rawurl, nil return rawurl, nil
} }
// NewGitea returns a gitea client implementation // NewGitea returns a gitea client implementation.
func NewGitea(ctx *context.Context) (Client, error) { func NewGitea(ctx *context.Context) (Client, error) {
instanceURL, err := getInstanceURL(ctx.Config.GiteaURLs.API) instanceURL, err := getInstanceURL(ctx.Config.GiteaURLs.API)
if err != nil { if err != nil {
@ -52,7 +52,7 @@ func NewGitea(ctx *context.Context) (Client, error) {
} }
// CreateFile creates a file in the repository at a given path // CreateFile creates a file in the repository at a given path
// or updates the file if it exists // or updates the file if it exists.
func (c *giteaClient) CreateFile( func (c *giteaClient) CreateFile(
ctx *context.Context, ctx *context.Context,
commitAuthor config.CommitAuthor, commitAuthor config.CommitAuthor,
@ -132,7 +132,7 @@ func (c *giteaClient) updateRelease(ctx *context.Context, title, body string, id
} }
// CreateRelease creates a new release or updates it by keeping // CreateRelease creates a new release or updates it by keeping
// the release notes if it exists // the release notes if it exists.
func (c *giteaClient) CreateRelease(ctx *context.Context, body string) (string, error) { func (c *giteaClient) CreateRelease(ctx *context.Context, body string) (string, error) {
var release *gitea.Release var release *gitea.Release
var err error var err error
@ -168,7 +168,7 @@ func (c *giteaClient) CreateRelease(ctx *context.Context, body string) (string,
return strconv.FormatInt(release.ID, 10), nil return strconv.FormatInt(release.ID, 10), nil
} }
// Upload uploads a file into a release repository // Upload uploads a file into a release repository.
func (c *giteaClient) Upload( func (c *giteaClient) Upload(
ctx *context.Context, ctx *context.Context,
releaseID string, releaseID string,

View File

@ -21,14 +21,13 @@ type githubClient struct {
client *github.Client client *github.Client
} }
// NewGitHub returns a github client implementation // NewGitHub returns a github client implementation.
func NewGitHub(ctx *context.Context) (Client, error) { func NewGitHub(ctx *context.Context) (Client, error) {
ts := oauth2.StaticTokenSource( ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: ctx.Token}, &oauth2.Token{AccessToken: ctx.Token},
) )
httpClient := oauth2.NewClient(ctx, ts) httpClient := oauth2.NewClient(ctx, ts)
base := httpClient.Transport.(*oauth2.Transport).Base base := httpClient.Transport.(*oauth2.Transport).Base
// nolint: govet
if base == nil || reflect.ValueOf(base).IsNil() { if base == nil || reflect.ValueOf(base).IsNil() {
base = http.DefaultTransport base = http.DefaultTransport
} }

View File

@ -15,14 +15,14 @@ import (
"github.com/xanzy/go-gitlab" "github.com/xanzy/go-gitlab"
) )
// ErrExtractHashFromFileUploadURL indicates the file upload hash could not ne extracted from the url // ErrExtractHashFromFileUploadURL indicates the file upload hash could not ne extracted from the url.
var ErrExtractHashFromFileUploadURL = errors.New("could not extract hash from gitlab file upload url") var ErrExtractHashFromFileUploadURL = errors.New("could not extract hash from gitlab file upload url")
type gitlabClient struct { type gitlabClient struct {
client *gitlab.Client client *gitlab.Client
} }
// NewGitLab returns a gitlab client implementation // NewGitLab returns a gitlab client implementation.
func NewGitLab(ctx *context.Context) (Client, error) { func NewGitLab(ctx *context.Context) (Client, error) {
token := ctx.Token token := ctx.Token
transport := &http.Transport{ transport := &http.Transport{
@ -47,7 +47,7 @@ func NewGitLab(ctx *context.Context) (Client, error) {
} }
// CreateFile gets a file in the repository at a given path // CreateFile gets a file in the repository at a given path
// and updates if it exists or creates it for later pipes in the pipeline // and updates if it exists or creates it for later pipes in the pipeline.
func (c *gitlabClient) CreateFile( func (c *gitlabClient) CreateFile(
ctx *context.Context, ctx *context.Context,
commitAuthor config.CommitAuthor, commitAuthor config.CommitAuthor,
@ -157,7 +157,7 @@ func (c *gitlabClient) CreateFile(
} }
// CreateRelease creates a new release or updates it by keeping // CreateRelease creates a new release or updates it by keeping
// the release notes if it exists // the release notes if it exists.
func (c *gitlabClient) CreateRelease(ctx *context.Context, body string) (releaseID string, err error) { func (c *gitlabClient) CreateRelease(ctx *context.Context, body string) (releaseID string, err error) {
title, err := tmpl.New(ctx).Apply(ctx.Config.Release.NameTemplate) title, err := tmpl.New(ctx).Apply(ctx.Config.Release.NameTemplate)
if err != nil { if err != nil {
@ -229,7 +229,7 @@ func (c *gitlabClient) CreateRelease(ctx *context.Context, body string) (release
return tagName, err // gitlab references a tag in a repo by its name return tagName, err // gitlab references a tag in a repo by its name
} }
// Upload uploads a file into a release repository // Upload uploads a file into a release repository.
func (c *gitlabClient) Upload( func (c *gitlabClient) Upload(
ctx *context.Context, ctx *context.Context,
releaseID string, releaseID string,
@ -292,7 +292,7 @@ func (c *gitlabClient) Upload(
} }
// extractProjectFileHashFrom extracts the hash from the // extractProjectFileHashFrom extracts the hash from the
// relative project file url of the format '/uploads/<hash>/filename.ext' // relative project file url of the format '/uploads/<hash>/filename.ext'.
func extractProjectFileHashFrom(projectFileURL string) (string, error) { func extractProjectFileHashFrom(projectFileURL string) (string, error) {
log.WithField("projectFileURL", projectFileURL).Debug("extract file hash from") log.WithField("projectFileURL", projectFileURL).Debug("extract file hash from")
splittedProjectFileURL := strings.Split(projectFileURL, "/") splittedProjectFileURL := strings.Split(projectFileURL, "/")

View File

@ -13,7 +13,7 @@ import (
const baseURL = "https://goreleaser.com/deprecations#" const baseURL = "https://goreleaser.com/deprecations#"
// Notice warns the user about the deprecation of the given property // Notice warns the user about the deprecation of the given property.
func Notice(ctx *context.Context, property string) { func Notice(ctx *context.Context, property string) {
ctx.Deprecated = true ctx.Deprecated = true
cli.Default.Padding += 3 cli.Default.Padding += 3

View File

@ -111,7 +111,7 @@ type command struct {
} }
// resolveCommand returns the a command based on publisher template with replaced variables // resolveCommand returns the a command based on publisher template with replaced variables
// Those variables can be replaced by the given context, goos, goarch, goarm and more // Those variables can be replaced by the given context, goos, goarch, goarm and more.
func resolveCommand(ctx *context.Context, publisher config.Publisher, artifact *artifact.Artifact) (*command, error) { func resolveCommand(ctx *context.Context, publisher config.Publisher, artifact *artifact.Artifact) (*command, error) {
var err error var err error

View File

@ -9,13 +9,13 @@ import (
"github.com/apex/log" "github.com/apex/log"
) )
// IsRepo returns true if current folder is a git repository // IsRepo returns true if current folder is a git repository.
func IsRepo() bool { func IsRepo() bool {
out, err := Run("rev-parse", "--is-inside-work-tree") out, err := Run("rev-parse", "--is-inside-work-tree")
return err == nil && strings.TrimSpace(out) == "true" return err == nil && strings.TrimSpace(out) == "true"
} }
// Run runs a git command and returns its output or errors // Run runs a git command and returns its output or errors.
func Run(args ...string) (string, error) { func Run(args ...string) (string, error) {
// TODO: use exex.CommandContext here and refactor. // TODO: use exex.CommandContext here and refactor.
var extraArgs = []string{ var extraArgs = []string{
@ -34,7 +34,7 @@ func Run(args ...string) (string, error) {
return string(bts), nil return string(bts), nil
} }
// Clean the output // Clean the output.
func Clean(output string, err error) (string, error) { func Clean(output string, err error) (string, error) {
output = strings.Replace(strings.Split(output, "\n")[0], "'", "", -1) output = strings.Replace(strings.Split(output, "\n")[0], "'", "", -1)
if err != nil { if err != nil {

View File

@ -67,7 +67,7 @@ func assetOpenDefault(kind string, a *artifact.Artifact) (*asset, error) {
}, nil }, nil
} }
// Defaults sets default configuration options on upload structs // Defaults sets default configuration options on upload structs.
func Defaults(uploads []config.Upload) error { func Defaults(uploads []config.Upload) error {
for i := range uploads { for i := range uploads {
defaults(&uploads[i]) defaults(&uploads[i])
@ -84,7 +84,7 @@ func defaults(upload *config.Upload) {
} }
} }
// CheckConfig validates an upload configuration returning a descriptive error when appropriate // CheckConfig validates an upload configuration returning a descriptive error when appropriate.
func CheckConfig(ctx *context.Context, upload *config.Upload, kind string) error { func CheckConfig(ctx *context.Context, upload *config.Upload, kind string) error {
if upload.Target == "" { if upload.Target == "" {
return misconfigured(kind, upload, "missing target") return misconfigured(kind, upload, "missing target")
@ -142,7 +142,7 @@ func misconfigured(kind string, upload *config.Upload, reason string) error {
// It must return and error when the response must be considered a failure. // It must return and error when the response must be considered a failure.
type ResponseChecker func(*h.Response) error type ResponseChecker func(*h.Response) error
// Upload does the actual uploading work // Upload does the actual uploading work.
func Upload(ctx *context.Context, uploads []config.Upload, kind string, check ResponseChecker) error { func Upload(ctx *context.Context, uploads []config.Upload, kind string, check ResponseChecker) error {
if ctx.SkipPublish { if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled return pipe.ErrSkipPublishEnabled
@ -204,7 +204,7 @@ func uploadWithFilter(ctx *context.Context, upload *config.Upload, filter artifa
return g.Wait() return g.Wait()
} }
// uploadAsset uploads file to target and logs all actions // uploadAsset uploads file to target and logs all actions.
func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact.Artifact, kind string, check ResponseChecker) error { func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact.Artifact, kind string, check ResponseChecker) error {
username, err := getUsername(ctx, upload, kind) username, err := getUsername(ctx, upload, kind)
if err != nil { if err != nil {
@ -229,7 +229,7 @@ func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact
if err != nil { if err != nil {
return err return err
} }
defer asset.ReadCloser.Close() // nolint: errcheck defer asset.ReadCloser.Close()
// target url need to contain the artifact name unless the custom // target url need to contain the artifact name unless the custom
// artifact name is used // artifact name is used
@ -271,7 +271,7 @@ func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact
return nil return nil
} }
// uploadAssetToServer uploads the asset file to target // uploadAssetToServer uploads the asset file to target.
func uploadAssetToServer(ctx *context.Context, upload *config.Upload, target, username, secret string, headers map[string]string, a *asset, check ResponseChecker) (*h.Response, error) { func uploadAssetToServer(ctx *context.Context, upload *config.Upload, target, username, secret string, headers map[string]string, a *asset, check ResponseChecker) (*h.Response, error) {
req, err := newUploadRequest(upload.Method, target, username, secret, headers, a) req, err := newUploadRequest(upload.Method, target, username, secret, headers, a)
if err != nil { if err != nil {
@ -281,7 +281,7 @@ func uploadAssetToServer(ctx *context.Context, upload *config.Upload, target, us
return executeHTTPRequest(ctx, upload, req, check) return executeHTTPRequest(ctx, upload, req, check)
} }
// newUploadRequest creates a new h.Request for uploading // newUploadRequest creates a new h.Request for uploading.
func newUploadRequest(method, target, username, secret string, headers map[string]string, a *asset) (*h.Request, error) { func newUploadRequest(method, target, username, secret string, headers map[string]string, a *asset) (*h.Request, error) {
req, err := h.NewRequest(method, target, a.ReadCloser) req, err := h.NewRequest(method, target, a.ReadCloser)
if err != nil { if err != nil {
@ -320,7 +320,7 @@ func getHTTPClient(upload *config.Upload) (*h.Client, error) {
}, nil }, nil
} }
// executeHTTPRequest processes the http call with respect of context ctx // executeHTTPRequest processes the http call with respect of context ctx.
func executeHTTPRequest(ctx *context.Context, upload *config.Upload, req *h.Request, check ResponseChecker) (*h.Response, error) { func executeHTTPRequest(ctx *context.Context, upload *config.Upload, req *h.Request, check ResponseChecker) (*h.Response, error) {
client, err := getHTTPClient(upload) client, err := getHTTPClient(upload)
if err != nil { if err != nil {
@ -339,7 +339,7 @@ func executeHTTPRequest(ctx *context.Context, upload *config.Upload, req *h.Requ
return nil, err return nil, err
} }
defer resp.Body.Close() // nolint: errcheck defer resp.Body.Close()
err = check(resp) err = check(resp)
if err != nil { if err != nil {
@ -352,7 +352,7 @@ func executeHTTPRequest(ctx *context.Context, upload *config.Upload, req *h.Requ
} }
// resolveTargetTemplate returns the resolved target template with replaced variables // resolveTargetTemplate returns the resolved target template with replaced variables
// Those variables can be replaced by the given context, goos, goarch, goarm and more // Those variables can be replaced by the given context, goos, goarch, goarm and more.
func resolveTargetTemplate(ctx *context.Context, upload *config.Upload, artifact *artifact.Artifact) (string, error) { func resolveTargetTemplate(ctx *context.Context, upload *config.Upload, artifact *artifact.Artifact) (string, error) {
var replacements = map[string]string{} var replacements = map[string]string{}
if upload.Mode == ModeBinary { if upload.Mode == ModeBinary {

View File

@ -3,13 +3,13 @@ package ids
import "fmt" import "fmt"
// IDs is the IDs type // IDs is the IDs type.
type IDs struct { type IDs struct {
ids map[string]int ids map[string]int
kind string kind string
} }
// New IDs // New IDs.
func New(kind string) IDs { func New(kind string) IDs {
return IDs{ return IDs{
ids: map[string]int{}, ids: map[string]int{},
@ -17,12 +17,12 @@ func New(kind string) IDs {
} }
} }
// Inc increment the counter of the given id // Inc increment the counter of the given id.
func (i IDs) Inc(id string) { func (i IDs) Inc(id string) {
i.ids[id]++ i.ids[id]++
} }
// Validate errors if there are any ids with counter > 1 // Validate errors if there are any ids with counter > 1.
func (i IDs) Validate() error { func (i IDs) Validate() error {
for id, count := range i.ids { for id, count := range i.ids {
if count > 1 { if count > 1 {

View File

@ -3,10 +3,9 @@ package linux
import "strings" import "strings"
// Arch converts a goarch to a linux-compatible arch // Arch converts a goarch to a linux-compatible arch.
//
// list of all linux arches: `go tool dist list | grep linux`
func Arch(key string) string { func Arch(key string) string {
// XXX: list of all linux arches: `go tool dist list | grep linux`
var arch = strings.TrimPrefix(key, "linux") var arch = strings.TrimPrefix(key, "linux")
switch arch { switch arch {
case "386": case "386":

View File

@ -2,12 +2,12 @@ package logext
import "github.com/apex/log" import "github.com/apex/log"
// Writer writes with log.Info // Writer writes with log.Info.
type Writer struct { type Writer struct {
ctx *log.Entry ctx *log.Entry
} }
// NewWriter creates a new log writer // NewWriter creates a new log writer.
func NewWriter(ctx *log.Entry) Writer { func NewWriter(ctx *log.Entry) Writer {
return Writer{ctx: ctx} return Writer{ctx: ctx}
} }
@ -17,12 +17,12 @@ func (t Writer) Write(p []byte) (n int, err error) {
return len(p), nil return len(p), nil
} }
// Writer writes with log.Error // Writer writes with log.Error.
type ErrorWriter struct { type ErrorWriter struct {
ctx *log.Entry ctx *log.Entry
} }
// NewWriter creates a new log writer // NewWriter creates a new log writer.
func NewErrWriter(ctx *log.Entry) ErrorWriter { func NewErrWriter(ctx *log.Entry) ErrorWriter {
return ErrorWriter{ctx: ctx} return ErrorWriter{ctx: ctx}
} }

View File

@ -20,7 +20,6 @@ import (
"github.com/goreleaser/goreleaser/internal/semerrgroup" "github.com/goreleaser/goreleaser/internal/semerrgroup"
"github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/internal/tmpl"
"github.com/goreleaser/goreleaser/pkg/archive" "github.com/goreleaser/goreleaser/pkg/archive"
archivelib "github.com/goreleaser/goreleaser/pkg/archive"
"github.com/goreleaser/goreleaser/pkg/config" "github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
@ -33,14 +32,14 @@ const (
// nolint: gochecknoglobals // nolint: gochecknoglobals
var lock sync.Mutex var lock sync.Mutex
// Pipe for archive // Pipe for archive.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "archives" return "archives"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
var ids = ids.New("archives") var ids = ids.New("archives")
if len(ctx.Config.Archives) == 0 { if len(ctx.Config.Archives) == 0 {
@ -82,7 +81,7 @@ func (Pipe) Default(ctx *context.Context) error {
return ids.Validate() return ids.Validate()
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
var g = semerrgroup.New(ctx.Parallelism) var g = semerrgroup.New(ctx.Parallelism)
for _, archive := range ctx.Config.Archives { for _, archive := range ctx.Config.Archives {
@ -107,11 +106,11 @@ func (Pipe) Run(ctx *context.Context) error {
return g.Wait() return g.Wait()
} }
func create(ctx *context.Context, archive config.Archive, binaries []*artifact.Artifact) error { func create(ctx *context.Context, arch config.Archive, binaries []*artifact.Artifact) error {
var format = packageFormat(archive, binaries[0].Goos) var format = packageFormat(arch, binaries[0].Goos)
folder, err := tmpl.New(ctx). folder, err := tmpl.New(ctx).
WithArtifact(binaries[0], archive.Replacements). WithArtifact(binaries[0], arch.Replacements).
Apply(archive.NameTemplate) Apply(arch.NameTemplate)
if err != nil { if err != nil {
return err return err
} }
@ -131,23 +130,22 @@ func create(ctx *context.Context, archive config.Archive, binaries []*artifact.A
return fmt.Errorf("failed to create directory %s: %s", archivePath, err.Error()) return fmt.Errorf("failed to create directory %s: %s", archivePath, err.Error())
} }
lock.Unlock() lock.Unlock()
defer archiveFile.Close() // nolint: errcheck defer archiveFile.Close()
var log = log.WithField("archive", archivePath) var log = log.WithField("archive", archivePath)
log.Info("creating") log.Info("creating")
template := tmpl.New(ctx). template := tmpl.New(ctx).
WithArtifact(binaries[0], archive.Replacements) WithArtifact(binaries[0], arch.Replacements)
wrap, err := template. wrap, err := template.Apply(wrapFolder(arch))
Apply(wrapFolder(archive))
if err != nil { if err != nil {
return err return err
} }
var a = NewEnhancedArchive(archivelib.New(archiveFile), wrap) var a = NewEnhancedArchive(archive.New(archiveFile), wrap)
defer a.Close() // nolint: errcheck defer a.Close()
files, err := findFiles(template, archive) files, err := findFiles(template, arch)
if err != nil { if err != nil {
return fmt.Errorf("failed to find files to archive: %s", err.Error()) return fmt.Errorf("failed to find files to archive: %s", err.Error())
} }
@ -171,8 +169,8 @@ func create(ctx *context.Context, archive config.Archive, binaries []*artifact.A
Gomips: binaries[0].Gomips, Gomips: binaries[0].Gomips,
Extra: map[string]interface{}{ Extra: map[string]interface{}{
"Builds": binaries, "Builds": binaries,
"ID": archive.ID, "ID": arch.ID,
"Format": archive.Format, "Format": arch.Format,
"WrappedIn": wrap, "WrappedIn": wrap,
}, },
}) })
@ -264,7 +262,7 @@ type EnhancedArchive struct {
files map[string]string files map[string]string
} }
// Add adds a file // Add adds a file.
func (d EnhancedArchive) Add(name, path string) error { func (d EnhancedArchive) Add(name, path string) error {
name = strings.Replace(filepath.Join(d.wrap, name), "\\", "/", -1) name = strings.Replace(filepath.Join(d.wrap, name), "\\", "/", -1)
log.Debugf("adding file: %s as %s", path, name) log.Debugf("adding file: %s as %s", path, name)
@ -275,7 +273,7 @@ func (d EnhancedArchive) Add(name, path string) error {
return d.a.Add(name, path) return d.a.Add(name, path)
} }
// Close closes the underlying archive // Close closes the underlying archive.
func (d EnhancedArchive) Close() error { func (d EnhancedArchive) Close() error {
return d.a.Close() return d.a.Close()
} }

View File

@ -27,23 +27,22 @@ type artifactoryResponse struct {
URI string `json:"uri,omitempty"` URI string `json:"uri,omitempty"`
} }
// artifactoryChecksums reflects the checksums generated by // artifactoryChecksums reflects the checksums generated by Artifactory.
// Artifactory
type artifactoryChecksums struct { type artifactoryChecksums struct {
SHA1 string `json:"sha1,omitempty"` SHA1 string `json:"sha1,omitempty"`
MD5 string `json:"md5,omitempty"` MD5 string `json:"md5,omitempty"`
SHA256 string `json:"sha256,omitempty"` SHA256 string `json:"sha256,omitempty"`
} }
// Pipe for Artifactory // Pipe for Artifactory.
type Pipe struct{} type Pipe struct{}
// String returns the description of the pipe // String returns the description of the pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "artifactory" return "artifactory"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
for i := range ctx.Config.Artifactories { for i := range ctx.Config.Artifactories {
ctx.Config.Artifactories[i].ChecksumHeader = "X-Checksum-SHA256" ctx.Config.Artifactories[i].ChecksumHeader = "X-Checksum-SHA256"
@ -52,7 +51,7 @@ func (Pipe) Default(ctx *context.Context) error {
return http.Defaults(ctx.Config.Artifactories) return http.Defaults(ctx.Config.Artifactories)
} }
// Publish artifacts to artifactory // Publish artifacts to artifactory.
// //
// Docs: https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-Example-DeployinganArtifact // Docs: https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-Example-DeployinganArtifact
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {

View File

@ -1,3 +1,4 @@
// Package before provides the pipe implementation that runs before all other pipes.
package before package before
import ( import (
@ -11,15 +12,15 @@ import (
"github.com/mattn/go-shellwords" "github.com/mattn/go-shellwords"
) )
// Pipe is a global hook pipe // Pipe is a global hook pipe.
type Pipe struct{} type Pipe struct{}
// String is the name of this pipe // String is the name of this pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "running before hooks" return "running before hooks"
} }
// Run executes the hooks // Run executes the hooks.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
var tmpl = tmpl.New(ctx) var tmpl = tmpl.New(ctx)
/* #nosec */ /* #nosec */

View File

@ -1,3 +1,4 @@
// Package blob provides the pipe implementation that uploads files to "blob" providers, such as s3, gcs and azure.
package blob package blob
import ( import (
@ -9,15 +10,15 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for Artifactory // Pipe for blobs.
type Pipe struct{} type Pipe struct{}
// String returns the description of the pipe // String returns the description of the pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "blobs" return "blobs"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
for i := range ctx.Config.Blobs { for i := range ctx.Config.Blobs {
blob := &ctx.Config.Blobs[i] blob := &ctx.Config.Blobs[i]
@ -32,7 +33,7 @@ func (Pipe) Default(ctx *context.Context) error {
return nil return nil
} }
// Publish to specified blob bucket url // Publish to specified blob bucket url.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if len(ctx.Config.Blobs) == 0 { if len(ctx.Config.Blobs) == 0 {
return pipe.Skip("blobs section is not configured") return pipe.Skip("blobs section is not configured")
@ -48,7 +49,7 @@ func (Pipe) Publish(ctx *context.Context) error {
return g.Wait() return g.Wait()
} }
// errorContains check if error contains specific string // errorContains check if error contains specific string.
func errorContains(err error, subs ...string) bool { func errorContains(err error, subs ...string) bool {
for _, sub := range subs { for _, sub := range subs {
if strings.Contains(err.Error(), sub) { if strings.Contains(err.Error(), sub) {

View File

@ -62,7 +62,7 @@ func urlFor(ctx *context.Context, conf config.Blob) (string, error) {
// Takes goreleaser context(which includes artificats) and bucketURL for // Takes goreleaser context(which includes artificats) and bucketURL for
// upload to destination (eg: gs://gorelease-bucket) using the given uploader // upload to destination (eg: gs://gorelease-bucket) using the given uploader
// implementation // implementation.
func doUpload(ctx *context.Context, conf config.Blob) error { func doUpload(ctx *context.Context, conf config.Blob) error {
folder, err := tmpl.New(ctx).Apply(conf.Folder) folder, err := tmpl.New(ctx).Apply(conf.Folder)
if err != nil { if err != nil {
@ -186,7 +186,7 @@ func getData(ctx *context.Context, conf config.Blob, path string) ([]byte, error
return data, err return data, err
} }
// uploader implements upload // uploader implements upload.
type uploader interface { type uploader interface {
io.Closer io.Closer
Open(ctx *context.Context, url string) error Open(ctx *context.Context, url string) error
@ -194,7 +194,7 @@ type uploader interface {
} }
// skipUploader is used when --skip-upload is set and will just log // skipUploader is used when --skip-upload is set and will just log
// things without really doing anything // things without really doing anything.
type skipUploader struct{} type skipUploader struct{}
func (u *skipUploader) Close() error { return nil } func (u *skipUploader) Close() error { return nil }
@ -205,7 +205,7 @@ func (u *skipUploader) Upload(_ *context.Context, path string, _ []byte) error {
return nil return nil
} }
// productionUploader actually do upload to // productionUploader actually do upload to.
type productionUploader struct { type productionUploader struct {
bucket *blob.Bucket bucket *blob.Bucket
} }

View File

@ -19,17 +19,17 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// ErrNoArchivesFound happens when 0 archives are found // ErrNoArchivesFound happens when 0 archives are found.
var ErrNoArchivesFound = errors.New("no linux/macos archives found") var ErrNoArchivesFound = errors.New("no linux/macos archives found")
// ErrMultipleArchivesSameOS happens when the config yields multiple archives // ErrMultipleArchivesSameOS happens when the config yields multiple archives
// for linux or windows. // for linux or windows.
var ErrMultipleArchivesSameOS = errors.New("one tap can handle only archive of an OS/Arch combination. Consider using ids in the brew section") var ErrMultipleArchivesSameOS = errors.New("one tap can handle only archive of an OS/Arch combination. Consider using ids in the brew section")
// ErrEmptyTokenType indicates unknown token type // ErrEmptyTokenType indicates unknown token type.
var ErrEmptyTokenType = errors.New("no token type found") var ErrEmptyTokenType = errors.New("no token type found")
// ErrTokenTypeNotImplementedForBrew indicates that a new token type was not implemented for this pipe // ErrTokenTypeNotImplementedForBrew indicates that a new token type was not implemented for this pipe.
type ErrTokenTypeNotImplementedForBrew struct { type ErrTokenTypeNotImplementedForBrew struct {
TokenType context.TokenType TokenType context.TokenType
} }
@ -41,14 +41,14 @@ func (e ErrTokenTypeNotImplementedForBrew) Error() string {
return "token type not implemented for brew pipe" return "token type not implemented for brew pipe"
} }
// Pipe for brew deployment // Pipe for brew deployment.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "homebrew tap formula" return "homebrew tap formula"
} }
// Publish brew formula // Publish brew formula.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
client, err := client.New(ctx) client, err := client.New(ctx)
if err != nil { if err != nil {
@ -62,7 +62,7 @@ func (Pipe) Publish(ctx *context.Context) error {
return nil return nil
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
for i := range ctx.Config.Brews { for i := range ctx.Config.Brews {
var brew = &ctx.Config.Brews[i] var brew = &ctx.Config.Brews[i]
@ -156,7 +156,7 @@ func doRun(ctx *context.Context, brew config.Homebrew, client client.Client) err
var filename = brew.Name + ".rb" var filename = brew.Name + ".rb"
var path = filepath.Join(ctx.Config.Dist, filename) var path = filepath.Join(ctx.Config.Dist, filename)
log.WithField("formula", path).Info("writing") log.WithField("formula", path).Info("writing")
if err := ioutil.WriteFile(path, []byte(content), 0644); err != nil { if err := ioutil.WriteFile(path, []byte(content), 0644); err != nil { //nolint: gosec
return errors.Wrap(err, "failed to write brew tap") return errors.Wrap(err, "failed to write brew tap")
} }
@ -268,7 +268,8 @@ func dataFor(ctx *context.Context, cfg config.Homebrew, tokenType context.TokenT
DownloadURL: url, DownloadURL: url,
SHA256: sum, SHA256: sum,
} }
if artifact.Goos == "darwin" { // TODO: refactor
if artifact.Goos == "darwin" { // nolint: nestif
if result.MacOS.DownloadURL != "" { if result.MacOS.DownloadURL != "" {
return result, ErrMultipleArchivesSameOS return result, ErrMultipleArchivesSameOS
} }

View File

@ -23,14 +23,14 @@ import (
_ "github.com/goreleaser/goreleaser/internal/builders/golang" _ "github.com/goreleaser/goreleaser/internal/builders/golang"
) )
// Pipe for build // Pipe for build.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "building binaries" return "building binaries"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
for _, build := range ctx.Config.Builds { for _, build := range ctx.Config.Builds {
if build.Skip { if build.Skip {
@ -45,7 +45,7 @@ func (Pipe) Run(ctx *context.Context) error {
return nil return nil
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
var ids = ids.New("builds") var ids = ids.New("builds")
for i, build := range ctx.Config.Builds { for i, build := range ctx.Config.Builds {

View File

@ -17,17 +17,17 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// ErrInvalidSortDirection happens when the sort order is invalid // ErrInvalidSortDirection happens when the sort order is invalid.
var ErrInvalidSortDirection = errors.New("invalid sort direction") var ErrInvalidSortDirection = errors.New("invalid sort direction")
// Pipe for checksums // Pipe for checksums.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "generating changelog" return "generating changelog"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
// TODO: should probably have a different field for the filename and its // TODO: should probably have a different field for the filename and its
// contents. // contents.
@ -93,7 +93,7 @@ func (Pipe) Run(ctx *context.Context) error {
var path = filepath.Join(ctx.Config.Dist, "CHANGELOG.md") var path = filepath.Join(ctx.Config.Dist, "CHANGELOG.md")
log.WithField("changelog", path).Info("writing") log.WithField("changelog", path).Info("writing")
return ioutil.WriteFile(path, []byte(ctx.ReleaseNotes), 0644) return ioutil.WriteFile(path, []byte(ctx.ReleaseNotes), 0644) //nolint: gosec
} }
func loadFromFile(file string) (string, error) { func loadFromFile(file string) (string, error) {
@ -204,7 +204,7 @@ func previous(tag string) (result string, err error) {
// nolint: gochecknoglobals // nolint: gochecknoglobals
var validSHA1 = regexp.MustCompile(`^[a-fA-F0-9]{40}$`) var validSHA1 = regexp.MustCompile(`^[a-fA-F0-9]{40}$`)
// isSHA1 te lets us know if the ref is a SHA1 or not // isSHA1 te lets us know if the ref is a SHA1 or not.
func isSHA1(ref string) bool { func isSHA1(ref string) bool {
return validSHA1.MatchString(ref) return validSHA1.MatchString(ref)
} }

View File

@ -15,14 +15,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for checksums // Pipe for checksums.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "calculating checksums" return "calculating checksums"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
if ctx.Config.Checksum.NameTemplate == "" { if ctx.Config.Checksum.NameTemplate == "" {
ctx.Config.Checksum.NameTemplate = "{{ .ProjectName }}_{{ .Version }}_checksums.txt" ctx.Config.Checksum.NameTemplate = "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
@ -33,7 +33,7 @@ func (Pipe) Default(ctx *context.Context) error {
return nil return nil
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
artifactList := ctx.Artifacts.Filter( artifactList := ctx.Artifacts.Filter(
artifact.Or( artifact.Or(
@ -54,12 +54,12 @@ func (Pipe) Run(ctx *context.Context) (err error) {
file, err := os.OpenFile( file, err := os.OpenFile(
filepath.Join(ctx.Config.Dist, filename), filepath.Join(ctx.Config.Dist, filename),
os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_TRUNC,
0444, 0644,
) )
if err != nil { if err != nil {
return err return err
} }
defer file.Close() // nolint: errcheck defer file.Close()
var g = semerrgroup.New(ctx.Parallelism) var g = semerrgroup.New(ctx.Parallelism)
for _, artifact := range artifactList { for _, artifact := range artifactList {

View File

@ -7,15 +7,15 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for custom publisher // Pipe for custom publisher.
type Pipe struct{} type Pipe struct{}
// String returns the description of the pipe // String returns the description of the pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "custom publisher" return "custom publisher"
} }
// Publish artifacts // Publish artifacts.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if len(ctx.Config.Publishers) == 0 { if len(ctx.Config.Publishers) == 0 {
return pipe.Skip("publishers section is not configured") return pipe.Skip("publishers section is not configured")

View File

@ -8,14 +8,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/defaults" "github.com/goreleaser/goreleaser/pkg/defaults"
) )
// Pipe that sets the defaults // Pipe that sets the defaults.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "setting defaults" return "setting defaults"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
if ctx.Config.Dist == "" { if ctx.Config.Dist == "" {
ctx.Config.Dist = "dist" ctx.Config.Dist = "dist"

View File

@ -11,14 +11,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for cleandis // Pipe for dist.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "checking ./dist" return "checking ./dist"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
_, err = os.Stat(ctx.Config.Dist) _, err = os.Stat(ctx.Config.Dist)
if os.IsNotExist(err) { if os.IsNotExist(err) {

View File

@ -19,17 +19,17 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// ErrNoDocker is shown when docker cannot be found in $PATH // ErrNoDocker is shown when docker cannot be found in $PATH.
var ErrNoDocker = errors.New("docker not present in $PATH") var ErrNoDocker = errors.New("docker not present in $PATH")
// Pipe for docker // Pipe for docker.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "docker images" return "docker images"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
for i := range ctx.Config.Dockers { for i := range ctx.Config.Dockers {
var docker = &ctx.Config.Dockers[i] var docker = &ctx.Config.Dockers[i]
@ -61,7 +61,7 @@ func (Pipe) Default(ctx *context.Context) error {
return nil return nil
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
if len(ctx.Config.Dockers) == 0 || len(ctx.Config.Dockers[0].ImageTemplates) == 0 { if len(ctx.Config.Dockers) == 0 || len(ctx.Config.Dockers[0].ImageTemplates) == 0 {
return pipe.Skip("docker section is not configured") return pipe.Skip("docker section is not configured")
@ -73,7 +73,7 @@ func (Pipe) Run(ctx *context.Context) error {
return doRun(ctx) return doRun(ctx)
} }
// Publish the docker images // Publish the docker images.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if ctx.SkipPublish { if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled return pipe.ErrSkipPublishEnabled
@ -227,7 +227,7 @@ func processBuildFlagTemplates(ctx *context.Context, docker config.Docker) ([]st
return buildFlags, nil return buildFlags, nil
} }
// walks the src, recreating dirs and hard-linking files // walks the src, recreating dirs and hard-linking files.
func link(src, dest string) error { func link(src, dest string) error {
return filepath.Walk(src, func(path string, info os.FileInfo, err error) error { return filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
if err != nil { if err != nil {

View File

@ -9,7 +9,7 @@ import (
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
) )
// Pipe that writes the effective config file to dist // Pipe that writes the effective config file to dist.
type Pipe struct { type Pipe struct {
} }
@ -17,7 +17,7 @@ func (Pipe) String() string {
return "writing effective config file" return "writing effective config file"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
var path = filepath.Join(ctx.Config.Dist, "config.yaml") var path = filepath.Join(ctx.Config.Dist, "config.yaml")
bts, err := yaml.Marshal(ctx.Config) bts, err := yaml.Marshal(ctx.Config)
@ -25,5 +25,5 @@ func (Pipe) Run(ctx *context.Context) (err error) {
return err return err
} }
log.WithField("config", path).Info("writing") log.WithField("config", path).Info("writing")
return ioutil.WriteFile(path, bts, 0644) return ioutil.WriteFile(path, bts, 0644) //nolint: gosec
} }

View File

@ -12,14 +12,14 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// ErrMissingToken indicates an error when GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN are all missing in the environment // ErrMissingToken indicates an error when GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN are all missing in the environment.
var ErrMissingToken = errors.New("missing GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN") var ErrMissingToken = errors.New("missing GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN")
// ErrMultipleTokens indicates that multiple tokens are defined. ATM only one of them if allowed // ErrMultipleTokens indicates that multiple tokens are defined. ATM only one of them if allowed.
// See https://github.com/goreleaser/goreleaser/pull/809 // See https://github.com/goreleaser/goreleaser/pull/809
var ErrMultipleTokens = errors.New("multiple tokens defined. Only one is allowed") var ErrMultipleTokens = errors.New("multiple tokens defined. Only one is allowed")
// Pipe for env // Pipe for env.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
@ -39,7 +39,7 @@ func setDefaultTokenFiles(ctx *context.Context) {
} }
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
setDefaultTokenFiles(ctx) setDefaultTokenFiles(ctx)
githubToken, githubTokenErr := loadEnv("GITHUB_TOKEN", ctx.Config.EnvFiles.GitHubToken) githubToken, githubTokenErr := loadEnv("GITHUB_TOKEN", ctx.Config.EnvFiles.GitHubToken)

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
) )
// ErrDirty happens when the repo has uncommitted/unstashed changes // ErrDirty happens when the repo has uncommitted/unstashed changes.
type ErrDirty struct { type ErrDirty struct {
status string status string
} }
@ -14,7 +14,7 @@ func (e ErrDirty) Error() string {
return fmt.Sprintf("git is currently in a dirty state, please check in your pipeline what can be changing the following files:\n%v", e.status) return fmt.Sprintf("git is currently in a dirty state, please check in your pipeline what can be changing the following files:\n%v", e.status)
} }
// ErrWrongRef happens when the HEAD reference is different from the tag being built // ErrWrongRef happens when the HEAD reference is different from the tag being built.
type ErrWrongRef struct { type ErrWrongRef struct {
commit, tag string commit, tag string
} }

View File

@ -13,14 +13,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe that sets up git state // Pipe that sets up git state.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "getting and validating git state" return "getting and validating git state"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
if _, err := exec.LookPath("git"); err != nil { if _, err := exec.LookPath("git"); err != nil {
return ErrNoGit return ErrNoGit

View File

@ -1,4 +1,4 @@
// Package nfpm implements the Pipe interface providing NFPM bindings. // Package nfpm implements the Pipe interface providing nFPM bindings.
package nfpm package nfpm
import ( import (
@ -25,14 +25,14 @@ import (
const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
// Pipe for fpm packaging // Pipe for nfpm packaging.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "linux packages" return "linux packages"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
var ids = ids.New("nfpms") var ids = ids.New("nfpms")
for i := range ctx.Config.NFPMs { for i := range ctx.Config.NFPMs {
@ -62,7 +62,7 @@ func (Pipe) Default(ctx *context.Context) error {
return ids.Validate() return ids.Validate()
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
for _, nfpm := range ctx.Config.NFPMs { for _, nfpm := range ctx.Config.NFPMs {
if len(nfpm.Formats) == 0 { if len(nfpm.Formats) == 0 {
@ -189,7 +189,7 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries
if err != nil { if err != nil {
return err return err
} }
defer w.Close() // nolint: errcheck defer w.Close()
if err := packager.Package(nfpm.WithDefaults(info), w); err != nil { if err := packager.Package(nfpm.WithDefaults(info), w); err != nil {
return errors.Wrap(err, "nfpm failed") return errors.Wrap(err, "nfpm failed")
} }

View File

@ -17,23 +17,23 @@ var ErrSkipSignEnabled = Skip("artifact signing is disabled")
// It means that the part of a Piper that validates some things was not run. // It means that the part of a Piper that validates some things was not run.
var ErrSkipValidateEnabled = Skip("validation is disabled") var ErrSkipValidateEnabled = Skip("validation is disabled")
// IsSkip returns true if the error is an ErrSkip // IsSkip returns true if the error is an ErrSkip.
func IsSkip(err error) bool { func IsSkip(err error) bool {
_, ok := err.(ErrSkip) _, ok := err.(ErrSkip)
return ok return ok
} }
// ErrSkip occurs when a pipe is skipped for some reason // ErrSkip occurs when a pipe is skipped for some reason.
type ErrSkip struct { type ErrSkip struct {
reason string reason string
} }
// Error implements the error interface. returns the reason the pipe was skipped // Error implements the error interface. returns the reason the pipe was skipped.
func (e ErrSkip) Error() string { func (e ErrSkip) Error() string {
return e.reason return e.reason
} }
// Skip skips this pipe with the given reason // Skip skips this pipe with the given reason.
func Skip(reason string) ErrSkip { func Skip(reason string) ErrSkip {
return ErrSkip{reason: reason} return ErrSkip{reason: reason}
} }

View File

@ -7,14 +7,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe implemens defaulter to set the project name // Pipe implemens defaulter to set the project name.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "project name" return "project name"
} }
// Default set project defaults // Default set project defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
if ctx.Config.ProjectName == "" { if ctx.Config.ProjectName == "" {
switch { switch {

View File

@ -18,14 +18,14 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Pipe that publishes artifacts // Pipe that publishes artifacts.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "publishing" return "publishing"
} }
// Publisher should be implemented by pipes that want to publish artifacts // Publisher should be implemented by pipes that want to publish artifacts.
type Publisher interface { type Publisher interface {
fmt.Stringer fmt.Stringer
@ -48,7 +48,7 @@ var publishers = []Publisher{
scoop.Pipe{}, scoop.Pipe{},
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
for _, publisher := range publishers { for _, publisher := range publishers {
if err := middleware.Logging( if err := middleware.Logging(

View File

@ -14,18 +14,18 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// ErrMultipleReleases indicates that multiple releases are defined. ATM only one of them is allowed // ErrMultipleReleases indicates that multiple releases are defined. ATM only one of them is allowed.
// See https://github.com/goreleaser/goreleaser/pull/809 // See https://github.com/goreleaser/goreleaser/pull/809
var ErrMultipleReleases = errors.New("multiple releases are defined. Only one is allowed") var ErrMultipleReleases = errors.New("multiple releases are defined. Only one is allowed")
// Pipe for github release // Pipe for github release.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "github/gitlab/gitea releases" return "github/gitlab/gitea releases"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
numOfReleases := 0 numOfReleases := 0
if ctx.Config.Release.GitHub.String() != "" { if ctx.Config.Release.GitHub.String() != "" {
@ -96,7 +96,7 @@ func (Pipe) Default(ctx *context.Context) error {
return nil return nil
} }
// Publish github release // Publish the release.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if ctx.SkipPublish { if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled return pipe.ErrSkipPublishEnabled
@ -173,7 +173,7 @@ func upload(ctx *context.Context, cli client.Client, releaseID string, artifact
if err != nil { if err != nil {
return err return err
} }
defer file.Close() // nolint: errcheck defer file.Close()
log.WithField("file", file.Name()).WithField("name", artifact.Name).Info("uploading to release") log.WithField("file", file.Name()).WithField("name", artifact.Name).Info("uploading to release")
if err := cli.Upload(ctx, releaseID, artifact, file); err != nil { if err := cli.Upload(ctx, releaseID, artifact, file); err != nil {
log.WithField("try", try). log.WithField("try", try).

View File

@ -17,20 +17,20 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// ErrNoWindows when there is no build for windows (goos doesn't contain windows) // ErrNoWindows when there is no build for windows (goos doesn't contain windows).
var ErrNoWindows = errors.New("scoop requires a windows build") var ErrNoWindows = errors.New("scoop requires a windows build")
// ErrTokenTypeNotImplementedForScoop indicates that a new token type was not implemented for this pipe // ErrTokenTypeNotImplementedForScoop indicates that a new token type was not implemented for this pipe.
var ErrTokenTypeNotImplementedForScoop = errors.New("token type not implemented for scoop pipe") var ErrTokenTypeNotImplementedForScoop = errors.New("token type not implemented for scoop pipe")
// Pipe for build // Pipe for build.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "scoop manifests" return "scoop manifests"
} }
// Publish scoop manifest // Publish scoop manifest.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if ctx.SkipPublish { if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled return pipe.ErrSkipPublishEnabled
@ -42,7 +42,7 @@ func (Pipe) Publish(ctx *context.Context) error {
return doRun(ctx, client) return doRun(ctx, client)
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
if ctx.Config.Scoop.Name == "" { if ctx.Config.Scoop.Name == "" {
ctx.Config.Scoop.Name = ctx.Config.ProjectName ctx.Config.Scoop.Name = ctx.Config.ProjectName
@ -125,8 +125,8 @@ func doRun(ctx *context.Context, client client.Client) error {
) )
} }
// Manifest represents a scoop.sh App Manifest, more info: // Manifest represents a scoop.sh App Manifest.
// https://github.com/lukesampson/scoop/wiki/App-Manifests // more info: https://github.com/lukesampson/scoop/wiki/App-Manifests
type Manifest struct { type Manifest struct {
Version string `json:"version"` // The version of the app that this manifest installs. Version string `json:"version"` // The version of the app that this manifest installs.
Architecture map[string]Resource `json:"architecture"` // `architecture`: If the app has 32- and 64-bit versions, architecture can be used to wrap the differences. Architecture map[string]Resource `json:"architecture"` // `architecture`: If the app has 32- and 64-bit versions, architecture can be used to wrap the differences.
@ -136,7 +136,7 @@ type Manifest struct {
Persist []string `json:"persist,omitempty"` // Persist data between updates Persist []string `json:"persist,omitempty"` // Persist data between updates
} }
// Resource represents a combination of a url and a binary name for an architecture // Resource represents a combination of a url and a binary name for an architecture.
type Resource struct { type Resource struct {
URL string `json:"url"` // URL to the archive URL string `json:"url"` // URL to the archive
Bin []string `json:"bin"` // name of binary inside the archive Bin []string `json:"bin"` // name of binary inside the archive

View File

@ -8,15 +8,15 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Pipe is a global hook pipe // Pipe is a global hook pipe.
type Pipe struct{} type Pipe struct{}
// String is the name of this pipe // String is the name of this pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "parsing tag" return "parsing tag"
} }
// Run executes the hooks // Run executes the hooks.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
sv, err := semver.NewVersion(ctx.Git.CurrentTag) sv, err := semver.NewVersion(ctx.Git.CurrentTag)
if err != nil { if err != nil {

View File

@ -23,16 +23,16 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// ErrNoSnapcraft is shown when snapcraft cannot be found in $PATH // ErrNoSnapcraft is shown when snapcraft cannot be found in $PATH.
var ErrNoSnapcraft = errors.New("snapcraft not present in $PATH") var ErrNoSnapcraft = errors.New("snapcraft not present in $PATH")
// ErrNoDescription is shown when no description provided // ErrNoDescription is shown when no description provided.
var ErrNoDescription = errors.New("no description provided for snapcraft") var ErrNoDescription = errors.New("no description provided for snapcraft")
// ErrNoSummary is shown when no summary provided // ErrNoSummary is shown when no summary provided.
var ErrNoSummary = errors.New("no summary provided for snapcraft") var ErrNoSummary = errors.New("no summary provided for snapcraft")
// Metadata to generate the snap package // Metadata to generate the snap package.
type Metadata struct { type Metadata struct {
Name string Name string
Version string Version string
@ -47,7 +47,7 @@ type Metadata struct {
Plugs map[string]interface{} `yaml:",omitempty"` Plugs map[string]interface{} `yaml:",omitempty"`
} }
// AppMetadata for the binaries that will be in the snap package // AppMetadata for the binaries that will be in the snap package.
type AppMetadata struct { type AppMetadata struct {
Command string Command string
Plugs []string `yaml:",omitempty"` Plugs []string `yaml:",omitempty"`
@ -57,14 +57,14 @@ type AppMetadata struct {
const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
// Pipe for snapcraft packaging // Pipe for snapcraft packaging.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "snapcraft packages" return "snapcraft packages"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
var ids = ids.New("snapcrafts") var ids = ids.New("snapcrafts")
for i := range ctx.Config.Snapcrafts { for i := range ctx.Config.Snapcrafts {
@ -82,7 +82,7 @@ func (Pipe) Default(ctx *context.Context) error {
return ids.Validate() return ids.Validate()
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
for _, snap := range ctx.Config.Snapcrafts { for _, snap := range ctx.Config.Snapcrafts {
// TODO: deal with pipe.skip? // TODO: deal with pipe.skip?
@ -139,7 +139,7 @@ func isValidArch(arch string) bool {
return false return false
} }
// Publish packages // Publish packages.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if ctx.SkipPublish { if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled return pipe.ErrSkipPublishEnabled
@ -253,7 +253,7 @@ func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries [
if err := os.Link(config.Completer, destCompleterPath); err != nil { if err := os.Link(config.Completer, destCompleterPath); err != nil {
return errors.Wrap(err, "failed to link completer") return errors.Wrap(err, "failed to link completer")
} }
if err := os.Chmod(destCompleterPath, 0444); err != nil { if err := os.Chmod(destCompleterPath, 0644); err != nil {
return errors.Wrap(err, "failed to change completer permissions") return errors.Wrap(err, "failed to change completer permissions")
} }
appMetadata.Completer = config.Completer appMetadata.Completer = config.Completer
@ -270,7 +270,7 @@ func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries [
} }
log.WithField("file", file).Debugf("writing metadata file") log.WithField("file", file).Debugf("writing metadata file")
if err = ioutil.WriteFile(file, out, 0644); err != nil { if err = ioutil.WriteFile(file, out, 0644); err != nil { //nolint: gosec
return err return err
} }

View File

@ -10,14 +10,14 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Pipe for checksums // Pipe for checksums.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "snapshotting" return "snapshotting"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
if ctx.Config.Snapshot.NameTemplate == "" { if ctx.Config.Snapshot.NameTemplate == "" {
ctx.Config.Snapshot.NameTemplate = "{{ .Tag }}-SNAPSHOT-{{ .ShortCommit }}" ctx.Config.Snapshot.NameTemplate = "{{ .Tag }}-SNAPSHOT-{{ .ShortCommit }}"

View File

@ -12,14 +12,14 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for cleandis // Pipe for source archive.
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "creating source archive" return "creating source archive"
} }
// Run the pipe // Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
if !ctx.Config.Source.Enabled { if !ctx.Config.Source.Enabled {
return pipe.Skip("source pipe is disabled") return pipe.Skip("source pipe is disabled")
@ -45,7 +45,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
return err return err
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
var archive = &ctx.Config.Source var archive = &ctx.Config.Source
if archive.Format == "" { if archive.Format == "" {

View File

@ -1,4 +1,4 @@
// Package upload provides a Pipe that push using HTTP // Package upload provides a Pipe that push using HTTP.
package upload package upload
import ( import (
@ -10,20 +10,20 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// Pipe for http publishing // Pipe for http publishing.
type Pipe struct{} type Pipe struct{}
// String returns the description of the pipe // String returns the description of the pipe.
func (Pipe) String() string { func (Pipe) String() string {
return "http upload" return "http upload"
} }
// Default sets the pipe defaults // Default sets the pipe defaults.
func (Pipe) Default(ctx *context.Context) error { func (Pipe) Default(ctx *context.Context) error {
return http.Defaults(ctx.Config.Uploads) return http.Defaults(ctx.Config.Uploads)
} }
// Publish artifacts // Publish artifacts.
func (Pipe) Publish(ctx *context.Context) error { func (Pipe) Publish(ctx *context.Context) error {
if len(ctx.Config.Uploads) == 0 { if len(ctx.Config.Uploads) == 0 {
return pipe.Skip("uploads section is not configured") return pipe.Skip("uploads section is not configured")

View File

@ -9,7 +9,7 @@ import (
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
) )
// Group is the Semphore ErrorGroup itself // Group is the Semphore ErrorGroup itself.
type Group interface { type Group interface {
Go(func() error) Go(func() error)
Wait() error Wait() error

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
// GitInit inits a new git project // GitInit inits a new git project.
func GitInit(t *testing.T) { func GitInit(t *testing.T) {
out, err := fakeGit("init") out, err := fakeGit("init")
assert.NoError(t, err) assert.NoError(t, err)
@ -15,28 +15,28 @@ func GitInit(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
} }
// GitRemoteAdd adds the given url as remote // GitRemoteAdd adds the given url as remote.
func GitRemoteAdd(t *testing.T, url string) { func GitRemoteAdd(t *testing.T, url string) {
out, err := fakeGit("remote", "add", "origin", url) out, err := fakeGit("remote", "add", "origin", url)
assert.NoError(t, err) assert.NoError(t, err)
assert.Empty(t, out) assert.Empty(t, out)
} }
// GitCommit creates a git commits // GitCommit creates a git commits.
func GitCommit(t *testing.T, msg string) { func GitCommit(t *testing.T, msg string) {
out, err := fakeGit("commit", "--allow-empty", "-m", msg) out, err := fakeGit("commit", "--allow-empty", "-m", msg)
assert.NoError(t, err) assert.NoError(t, err)
assert.Contains(t, out, "master", msg) assert.Contains(t, out, "master", msg)
} }
// GitTag creates a git tag // GitTag creates a git tag.
func GitTag(t *testing.T, tag string) { func GitTag(t *testing.T, tag string) {
out, err := fakeGit("tag", tag) out, err := fakeGit("tag", tag)
assert.NoError(t, err) assert.NoError(t, err)
assert.Empty(t, out) assert.Empty(t, out)
} }
// GitAdd adds all files to stage // GitAdd adds all files to stage.
func GitAdd(t *testing.T) { func GitAdd(t *testing.T) {
out, err := fakeGit("add", "-A") out, err := fakeGit("add", "-A")
assert.NoError(t, err) assert.NoError(t, err)

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
// AssertSkipped asserts that a pipe was skipped // AssertSkipped asserts that a pipe was skipped.
func AssertSkipped(t *testing.T, err error) { func AssertSkipped(t *testing.T, err error) {
_, ok := err.(pipe.ErrSkip) _, ok := err.(pipe.ErrSkip)
assert.True(t, ok, "expected a pipe.ErrSkip but got %v", err) assert.True(t, ok, "expected a pipe.ErrSkip but got %v", err)

View File

@ -1,4 +1,4 @@
// Package tmpl provides templating utilities for goreleser // Package tmpl provides templating utilities for goreleaser.
package tmpl package tmpl
import ( import (
@ -14,7 +14,7 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Template holds data that can be applied to a template string // Template holds data that can be applied to a template string.
type Template struct { type Template struct {
fields Fields fields Fields
} }
@ -60,7 +60,7 @@ const (
target = "Target" target = "Target"
) )
// New Template // New Template.
func New(ctx *context.Context) *Template { func New(ctx *context.Context) *Template {
sv := ctx.Semver sv := ctx.Semver
rawVersionV := fmt.Sprintf("%d.%d.%d", sv.Major, sv.Minor, sv.Patch) rawVersionV := fmt.Sprintf("%d.%d.%d", sv.Major, sv.Minor, sv.Patch)
@ -88,7 +88,7 @@ func New(ctx *context.Context) *Template {
} }
// WithEnvS overrides template's env field with the given KEY=VALUE list of // WithEnvS overrides template's env field with the given KEY=VALUE list of
// environment variables // environment variables.
func (t *Template) WithEnvS(envs []string) *Template { func (t *Template) WithEnvS(envs []string) *Template {
var result = map[string]string{} var result = map[string]string{}
for _, env := range envs { for _, env := range envs {
@ -98,7 +98,7 @@ func (t *Template) WithEnvS(envs []string) *Template {
return t.WithEnv(result) return t.WithEnv(result)
} }
// WithEnv overrides template's env field with the given environment map // WithEnv overrides template's env field with the given environment map.
func (t *Template) WithEnv(e map[string]string) *Template { func (t *Template) WithEnv(e map[string]string) *Template {
t.fields[env] = e t.fields[env] = e
return t return t
@ -113,7 +113,7 @@ func (t *Template) WithExtraFields(f Fields) *Template {
return t return t
} }
// WithArtifact populates Fields from the artifact and replacements // WithArtifact populates Fields from the artifact and replacements.
func (t *Template) WithArtifact(a *artifact.Artifact, replacements map[string]string) *Template { func (t *Template) WithArtifact(a *artifact.Artifact, replacements map[string]string) *Template {
var bin = a.Extra[binary] var bin = a.Extra[binary]
if bin == nil { if bin == nil {

View File

@ -9,17 +9,17 @@ import (
"os" "os"
) )
// Archive as gz // Archive as gz.
type Archive struct { type Archive struct {
gw *gzip.Writer gw *gzip.Writer
} }
// Close all closeables // Close all closeables.
func (a Archive) Close() error { func (a Archive) Close() error {
return a.gw.Close() return a.gw.Close()
} }
// New gz archive // New gz archive.
func New(target io.Writer) Archive { func New(target io.Writer) Archive {
// the error will be nil since the compression level is valid // the error will be nil since the compression level is valid
gw, _ := gzip.NewWriterLevel(target, gzip.BestCompression) gw, _ := gzip.NewWriterLevel(target, gzip.BestCompression)
@ -28,7 +28,7 @@ func New(target io.Writer) Archive {
} }
} }
// Add file to the archive // Add file to the archive.
func (a Archive) Add(name, path string) error { func (a Archive) Add(name, path string) error {
if a.gw.Header.Name != "" { if a.gw.Header.Name != "" {
return fmt.Errorf("gzip: failed to add %s, only one file can be archived in gz format", name) return fmt.Errorf("gzip: failed to add %s, only one file can be archived in gz format", name)
@ -37,7 +37,7 @@ func (a Archive) Add(name, path string) error {
if err != nil { if err != nil {
return err return err
} }
defer file.Close() // nolint: errcheck defer file.Close()
info, err := file.Stat() info, err := file.Stat()
if err != nil { if err != nil {
return err return err

View File

@ -9,13 +9,13 @@ import (
"os" "os"
) )
// Archive as tar.gz // Archive as tar.gz.
type Archive struct { type Archive struct {
gw *gzip.Writer gw *gzip.Writer
tw *tar.Writer tw *tar.Writer
} }
// Close all closeables // Close all closeables.
func (a Archive) Close() error { func (a Archive) Close() error {
if err := a.tw.Close(); err != nil { if err := a.tw.Close(); err != nil {
return err return err
@ -23,7 +23,7 @@ func (a Archive) Close() error {
return a.gw.Close() return a.gw.Close()
} }
// New tar.gz archive // New tar.gz archive.
func New(target io.Writer) Archive { func New(target io.Writer) Archive {
// the error will be nil since the compression level is valid // the error will be nil since the compression level is valid
gw, _ := gzip.NewWriterLevel(target, gzip.BestCompression) gw, _ := gzip.NewWriterLevel(target, gzip.BestCompression)
@ -34,13 +34,13 @@ func New(target io.Writer) Archive {
} }
} }
// Add file to the archive // Add file to the archive.
func (a Archive) Add(name, path string) error { func (a Archive) Add(name, path string) error {
file, err := os.Open(path) // #nosec file, err := os.Open(path) // #nosec
if err != nil { if err != nil {
return err return err
} }
defer file.Close() // nolint: errcheck defer file.Close()
info, err := file.Stat() info, err := file.Stat()
if err != nil { if err != nil {
return err return err

View File

@ -10,13 +10,13 @@ import (
"github.com/ulikunitz/xz" "github.com/ulikunitz/xz"
) )
// Archive as tar.xz // Archive as tar.xz.
type Archive struct { type Archive struct {
xzw *xz.Writer xzw *xz.Writer
tw *tar.Writer tw *tar.Writer
} }
// Close all closeables // Close all closeables.
func (a Archive) Close() error { func (a Archive) Close() error {
if err := a.tw.Close(); err != nil { if err := a.tw.Close(); err != nil {
return err return err
@ -24,7 +24,7 @@ func (a Archive) Close() error {
return a.xzw.Close() return a.xzw.Close()
} }
// New tar.xz archive // New tar.xz archive.
func New(target io.Writer) Archive { func New(target io.Writer) Archive {
xzw, _ := xz.WriterConfig{DictCap: 16 * 1024 * 1024}.NewWriter(target) xzw, _ := xz.WriterConfig{DictCap: 16 * 1024 * 1024}.NewWriter(target)
tw := tar.NewWriter(xzw) tw := tar.NewWriter(xzw)
@ -34,13 +34,13 @@ func New(target io.Writer) Archive {
} }
} }
// Add file to the archive // Add file to the archive.
func (a Archive) Add(name, path string) error { func (a Archive) Add(name, path string) error {
file, err := os.Open(path) // #nosec file, err := os.Open(path) // #nosec
if err != nil { if err != nil {
return err return err
} }
defer file.Close() // nolint: errcheck defer file.Close()
info, err := file.Stat() info, err := file.Stat()
if err != nil { if err != nil {
return err return err

View File

@ -9,17 +9,17 @@ import (
"os" "os"
) )
// Archive zip struct // Archive zip struct.
type Archive struct { type Archive struct {
z *zip.Writer z *zip.Writer
} }
// Close all closeables // Close all closeables.
func (a Archive) Close() error { func (a Archive) Close() error {
return a.z.Close() return a.z.Close()
} }
// New zip archive // New zip archive.
func New(target io.Writer) Archive { func New(target io.Writer) Archive {
compressor := zip.NewWriter(target) compressor := zip.NewWriter(target)
compressor.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) { compressor.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {
@ -30,13 +30,13 @@ func New(target io.Writer) Archive {
} }
} }
// Add a file to the zip archive // Add a file to the zip archive.
func (a Archive) Add(name, path string) (err error) { func (a Archive) Add(name, path string) (err error) {
file, err := os.Open(path) // #nosec file, err := os.Open(path) // #nosec
if err != nil { if err != nil {
return return
} }
defer file.Close() // nolint: errcheck defer file.Close()
info, err := file.Stat() info, err := file.Stat()
if err != nil { if err != nil {
return return

View File

@ -14,24 +14,24 @@ var (
lock sync.Mutex lock sync.Mutex
) )
// Register registers a builder to a given lang // Register registers a builder to a given lang.
func Register(lang string, builder Builder) { func Register(lang string, builder Builder) {
lock.Lock() lock.Lock()
builders[lang] = builder builders[lang] = builder
lock.Unlock() lock.Unlock()
} }
// For gets the previously registered builder for the given lang // For gets the previously registered builder for the given lang.
func For(lang string) Builder { func For(lang string) Builder {
return builders[lang] return builders[lang]
} }
// Options to be passed down to a builder // Options to be passed down to a builder.
type Options struct { type Options struct {
Name, Path, Ext, Target string Name, Path, Ext, Target string
} }
// Builder defines a builder // Builder defines a builder.
type Builder interface { type Builder interface {
WithDefaults(build config.Build) config.Build WithDefaults(build config.Build) config.Build
Build(ctx *context.Context, build config.Build, options Options) error Build(ctx *context.Context, build config.Build, options Options) error

View File

@ -12,7 +12,7 @@ import (
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
) )
// GitHubURLs holds the URLs to be used when using github enterprise // GitHubURLs holds the URLs to be used when using github enterprise.
type GitHubURLs struct { type GitHubURLs struct {
API string `yaml:"api,omitempty"` API string `yaml:"api,omitempty"`
Upload string `yaml:"upload,omitempty"` Upload string `yaml:"upload,omitempty"`
@ -20,32 +20,32 @@ type GitHubURLs struct {
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"`
} }
// GitLabURLs holds the URLs to be used when using gitlab ce/enterprise // GitLabURLs holds the URLs to be used when using gitlab ce/enterprise.
type GitLabURLs struct { type GitLabURLs struct {
API string `yaml:"api,omitempty"` API string `yaml:"api,omitempty"`
Download string `yaml:"download,omitempty"` Download string `yaml:"download,omitempty"`
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"`
} }
// GiteaURLs holds the URLs to be used when using gitea // GiteaURLs holds the URLs to be used when using gitea.
type GiteaURLs struct { type GiteaURLs struct {
API string `yaml:"api,omitempty"` API string `yaml:"api,omitempty"`
SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"`
} }
// Repo represents any kind of repo (github, gitlab, etc) // Repo represents any kind of repo (github, gitlab, etc).
type Repo struct { type Repo struct {
Owner string `yaml:",omitempty"` Owner string `yaml:",omitempty"`
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
} }
// HomebrewDependency represents Homebrew dependency // HomebrewDependency represents Homebrew dependency.
type HomebrewDependency struct { type HomebrewDependency struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
Type string `yaml:",omitempty"` Type string `yaml:",omitempty"`
} }
// type alias to prevent stack overflowing in the custom unmarshaler // type alias to prevent stack overflowing in the custom unmarshaler.
type homebrewDependency HomebrewDependency type homebrewDependency HomebrewDependency
// UnmarshalYAML is a custom unmarshaler that accept brew deps in both the old and new format. // UnmarshalYAML is a custom unmarshaler that accept brew deps in both the old and new format.
@ -67,7 +67,7 @@ func (a *HomebrewDependency) UnmarshalYAML(unmarshal func(interface{}) error) er
return nil return nil
} }
// String of the repo, e.g. owner/name // String of the repo, e.g. owner/name.
func (r Repo) String() string { func (r Repo) String() string {
if r.Owner == "" && r.Name == "" { if r.Owner == "" && r.Name == "" {
return "" return ""
@ -75,7 +75,7 @@ func (r Repo) String() string {
return r.Owner + "/" + r.Name return r.Owner + "/" + r.Name
} }
// Homebrew contains the brew section // Homebrew contains the brew section.
type Homebrew struct { type Homebrew struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
GitHub Repo `yaml:",omitempty"` GitHub Repo `yaml:",omitempty"`
@ -99,7 +99,7 @@ type Homebrew struct {
Goarm string `yaml:"goarm,omitempty"` Goarm string `yaml:"goarm,omitempty"`
} }
// Scoop contains the scoop.sh section // Scoop contains the scoop.sh section.
type Scoop struct { type Scoop struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
Bucket Repo `yaml:",omitempty"` Bucket Repo `yaml:",omitempty"`
@ -113,27 +113,27 @@ type Scoop struct {
SkipUpload string `yaml:"skip_upload,omitempty"` SkipUpload string `yaml:"skip_upload,omitempty"`
} }
// CommitAuthor is the author of a Git commit // CommitAuthor is the author of a Git commit.
type CommitAuthor struct { type CommitAuthor struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
Email string `yaml:",omitempty"` Email string `yaml:",omitempty"`
} }
// Hooks define actions to run before and/or after something // Hooks define actions to run before and/or after something.
type Hooks struct { type Hooks struct {
Pre string `yaml:",omitempty"` Pre string `yaml:",omitempty"`
Post string `yaml:",omitempty"` Post string `yaml:",omitempty"`
} }
// IgnoredBuild represents a build ignored by the user // IgnoredBuild represents a build ignored by the user.
type IgnoredBuild struct { type IgnoredBuild struct {
Goos, Goarch, Goarm, Gomips string Goos, Goarch, Goarm, Gomips string
} }
// StringArray is a wrapper for an array of strings // StringArray is a wrapper for an array of strings.
type StringArray []string type StringArray []string
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays // UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error { func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
var strings []string var strings []string
if err := unmarshal(&strings); err != nil { if err := unmarshal(&strings); err != nil {
@ -148,10 +148,10 @@ func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil return nil
} }
// FlagArray is a wrapper for an array of strings // FlagArray is a wrapper for an array of strings.
type FlagArray []string type FlagArray []string
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays // UnmarshalYAML is a custom unmarshaler that wraps strings in arrays.
func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error { func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
var flags []string var flags []string
if err := unmarshal(&flags); err != nil { if err := unmarshal(&flags); err != nil {
@ -166,7 +166,7 @@ func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil return nil
} }
// Build contains the build configuration section // Build contains the build configuration section.
type Build struct { type Build struct {
ID string `yaml:",omitempty"` ID string `yaml:",omitempty"`
Goos []string `yaml:",omitempty"` Goos []string `yaml:",omitempty"`
@ -195,7 +195,7 @@ type HookConfig struct {
type BuildHooks []BuildHook type BuildHooks []BuildHook
// UnmarshalYAML is a custom unmarshaler that allows simplified declaration of single command // UnmarshalYAML is a custom unmarshaler that allows simplified declaration of single command.
func (bhc *BuildHooks) UnmarshalYAML(unmarshal func(interface{}) error) error { func (bhc *BuildHooks) UnmarshalYAML(unmarshal func(interface{}) error) error {
var singleCmd string var singleCmd string
err := unmarshal(&singleCmd) err := unmarshal(&singleCmd)
@ -219,7 +219,7 @@ type BuildHook struct {
Env []string `yaml:",omitempty"` Env []string `yaml:",omitempty"`
} }
// UnmarshalYAML is a custom unmarshaler that allows simplified declarations of commands as strings // UnmarshalYAML is a custom unmarshaler that allows simplified declarations of commands as strings.
func (bh *BuildHook) UnmarshalYAML(unmarshal func(interface{}) error) error { func (bh *BuildHook) UnmarshalYAML(unmarshal func(interface{}) error) error {
var cmd string var cmd string
if err := unmarshal(&cmd); err != nil { if err := unmarshal(&cmd); err != nil {
@ -242,7 +242,7 @@ type FormatOverride struct {
Format string `yaml:",omitempty"` Format string `yaml:",omitempty"`
} }
// Archive config used for the archive // Archive config used for the archive.
type Archive struct { type Archive struct {
ID string `yaml:",omitempty"` ID string `yaml:",omitempty"`
Builds []string `yaml:",omitempty"` Builds []string `yaml:",omitempty"`
@ -254,7 +254,7 @@ type Archive struct {
Files []string `yaml:",omitempty"` Files []string `yaml:",omitempty"`
} }
// Release config used for the GitHub/GitLab release // Release config used for the GitHub/GitLab release.
type Release struct { type Release struct {
GitHub Repo `yaml:",omitempty"` GitHub Repo `yaml:",omitempty"`
GitLab Repo `yaml:",omitempty"` GitLab Repo `yaml:",omitempty"`
@ -267,12 +267,12 @@ type Release struct {
ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"` ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"`
} }
// ExtraFile on a release // ExtraFile on a release.
type ExtraFile struct { type ExtraFile struct {
Glob string `yaml:"glob,omitempty"` Glob string `yaml:"glob,omitempty"`
} }
// NFPM config // NFPM config.
type NFPM struct { type NFPM struct {
NFPMOverridables `yaml:",inline"` NFPMOverridables `yaml:",inline"`
Overrides map[string]NFPMOverridables `yaml:"overrides,omitempty"` Overrides map[string]NFPMOverridables `yaml:"overrides,omitempty"`
@ -288,7 +288,7 @@ type NFPM struct {
Bindir string `yaml:",omitempty"` Bindir string `yaml:",omitempty"`
} }
// NFPMScripts is used to specify maintainer scripts // NFPMScripts is used to specify maintainer scripts.
type NFPMScripts struct { type NFPMScripts struct {
PreInstall string `yaml:"preinstall,omitempty"` PreInstall string `yaml:"preinstall,omitempty"`
PostInstall string `yaml:"postinstall,omitempty"` PostInstall string `yaml:"postinstall,omitempty"`
@ -296,7 +296,7 @@ type NFPMScripts struct {
PostRemove string `yaml:"postremove,omitempty"` PostRemove string `yaml:"postremove,omitempty"`
} }
// NFPMOverridables is used to specify per package format settings // NFPMOverridables is used to specify per package format settings.
type NFPMOverridables struct { type NFPMOverridables struct {
FileNameTemplate string `yaml:"file_name_template,omitempty"` FileNameTemplate string `yaml:"file_name_template,omitempty"`
PackageName string `yaml:"package_name,omitempty"` PackageName string `yaml:"package_name,omitempty"`
@ -313,7 +313,7 @@ type NFPMOverridables struct {
Scripts NFPMScripts `yaml:"scripts,omitempty"` Scripts NFPMScripts `yaml:"scripts,omitempty"`
} }
// Sign config // Sign config.
type Sign struct { type Sign struct {
ID string `yaml:"id,omitempty"` ID string `yaml:"id,omitempty"`
Cmd string `yaml:"cmd,omitempty"` Cmd string `yaml:"cmd,omitempty"`
@ -323,7 +323,7 @@ type Sign struct {
IDs []string `yaml:"ids,omitempty"` IDs []string `yaml:"ids,omitempty"`
} }
// SnapcraftAppMetadata for the binaries that will be in the snap package // SnapcraftAppMetadata for the binaries that will be in the snap package.
type SnapcraftAppMetadata struct { type SnapcraftAppMetadata struct {
Plugs []string Plugs []string
Daemon string Daemon string
@ -331,7 +331,7 @@ type SnapcraftAppMetadata struct {
Completer string `yaml:",omitempty"` Completer string `yaml:",omitempty"`
} }
// Snapcraft config // Snapcraft config.
type Snapcraft struct { type Snapcraft struct {
NameTemplate string `yaml:"name_template,omitempty"` NameTemplate string `yaml:"name_template,omitempty"`
Replacements map[string]string `yaml:",omitempty"` Replacements map[string]string `yaml:",omitempty"`
@ -350,18 +350,18 @@ type Snapcraft struct {
Plugs map[string]interface{} `yaml:",omitempty"` Plugs map[string]interface{} `yaml:",omitempty"`
} }
// Snapshot config // Snapshot config.
type Snapshot struct { type Snapshot struct {
NameTemplate string `yaml:"name_template,omitempty"` NameTemplate string `yaml:"name_template,omitempty"`
} }
// Checksum config // Checksum config.
type Checksum struct { type Checksum struct {
NameTemplate string `yaml:"name_template,omitempty"` NameTemplate string `yaml:"name_template,omitempty"`
Algorithm string `yaml:"algorithm,omitempty"` Algorithm string `yaml:"algorithm,omitempty"`
} }
// Docker image config // Docker image config.
type Docker struct { type Docker struct {
Binaries []string `yaml:",omitempty"` Binaries []string `yaml:",omitempty"`
Builds []string `yaml:",omitempty"` Builds []string `yaml:",omitempty"`
@ -375,12 +375,12 @@ type Docker struct {
BuildFlagTemplates []string `yaml:"build_flag_templates,omitempty"` BuildFlagTemplates []string `yaml:"build_flag_templates,omitempty"`
} }
// Filters config // Filters config.
type Filters struct { type Filters struct {
Exclude []string `yaml:",omitempty"` Exclude []string `yaml:",omitempty"`
} }
// Changelog Config // Changelog Config.
type Changelog struct { type Changelog struct {
Filters Filters `yaml:",omitempty"` Filters Filters `yaml:",omitempty"`
Sort string `yaml:",omitempty"` Sort string `yaml:",omitempty"`
@ -388,19 +388,19 @@ type Changelog struct {
} }
// EnvFiles holds paths to files that contains environment variables // EnvFiles holds paths to files that contains environment variables
// values like the github token for example // values like the github token for example.
type EnvFiles struct { type EnvFiles struct {
GitHubToken string `yaml:"github_token,omitempty"` GitHubToken string `yaml:"github_token,omitempty"`
GitLabToken string `yaml:"gitlab_token,omitempty"` GitLabToken string `yaml:"gitlab_token,omitempty"`
GiteaToken string `yaml:"gitea_token,omitempty"` GiteaToken string `yaml:"gitea_token,omitempty"`
} }
// Before config // Before config.
type Before struct { type Before struct {
Hooks []string `yaml:",omitempty"` Hooks []string `yaml:",omitempty"`
} }
// Blob contains config for GO CDK blob // Blob contains config for GO CDK blob.
type Blob struct { type Blob struct {
Bucket string `yaml:",omitempty"` Bucket string `yaml:",omitempty"`
Provider string `yaml:",omitempty"` Provider string `yaml:",omitempty"`
@ -413,7 +413,7 @@ type Blob struct {
ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"` ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"`
} }
// Upload configuration // Upload configuration.
type Upload struct { type Upload struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
IDs []string `yaml:"ids,omitempty"` IDs []string `yaml:"ids,omitempty"`
@ -428,7 +428,7 @@ type Upload struct {
CustomArtifactName bool `yaml:"custom_artifact_name,omitempty"` CustomArtifactName bool `yaml:"custom_artifact_name,omitempty"`
} }
// Publisher configuration // Publisher configuration.
type Publisher struct { type Publisher struct {
Name string `yaml:",omitempty"` Name string `yaml:",omitempty"`
IDs []string `yaml:"ids,omitempty"` IDs []string `yaml:"ids,omitempty"`
@ -439,14 +439,14 @@ type Publisher struct {
Env []string `yaml:",omitempty"` Env []string `yaml:",omitempty"`
} }
// Source configuration // Source configuration.
type Source struct { type Source struct {
NameTemplate string `yaml:"name_template,omitempty"` NameTemplate string `yaml:"name_template,omitempty"`
Format string `yaml:",omitempty"` Format string `yaml:",omitempty"`
Enabled bool `yaml:",omitempty"` Enabled bool `yaml:",omitempty"`
} }
// Project includes all project configuration // Project includes all project configuration.
type Project struct { type Project struct {
ProjectName string `yaml:"project_name,omitempty"` ProjectName string `yaml:"project_name,omitempty"`
Env []string `yaml:",omitempty"` Env []string `yaml:",omitempty"`
@ -484,7 +484,7 @@ type Project struct {
GiteaURLs GiteaURLs `yaml:"gitea_urls,omitempty"` GiteaURLs GiteaURLs `yaml:"gitea_urls,omitempty"`
} }
// Load config file // Load config file.
func Load(file string) (config Project, err error) { func Load(file string) (config Project, err error) {
f, err := os.Open(file) // #nosec f, err := os.Open(file) // #nosec
if err != nil { if err != nil {
@ -495,7 +495,7 @@ func Load(file string) (config Project, err error) {
return LoadReader(f) return LoadReader(f)
} }
// LoadReader config via io.Reader // LoadReader config via io.Reader.
func LoadReader(fd io.Reader) (config Project, err error) { func LoadReader(fd io.Reader) (config Project, err error) {
data, err := ioutil.ReadAll(fd) data, err := ioutil.ReadAll(fd)
if err != nil { if err != nil {

View File

@ -16,7 +16,7 @@ import (
"github.com/goreleaser/goreleaser/pkg/config" "github.com/goreleaser/goreleaser/pkg/config"
) )
// GitInfo includes tags and diffs used in some point // GitInfo includes tags and diffs used in some point.
type GitInfo struct { type GitInfo struct {
CurrentTag string CurrentTag string
Commit string Commit string
@ -25,7 +25,7 @@ type GitInfo struct {
URL string URL string
} }
// Env is the environment variables // Env is the environment variables.
type Env map[string]string type Env map[string]string
// Copy returns a copy of the environment. // Copy returns a copy of the environment.
@ -47,19 +47,19 @@ func (e Env) Strings() []string {
return result return result
} }
// TokenType is either github or gitlab // TokenType is either github or gitlab.
type TokenType string type TokenType string
const ( const (
// TokenTypeGitHub defines github as type of the token // TokenTypeGitHub defines github as type of the token.
TokenTypeGitHub TokenType = "github" TokenTypeGitHub TokenType = "github"
// TokenTypeGitLab defines gitlab as type of the token // TokenTypeGitLab defines gitlab as type of the token.
TokenTypeGitLab TokenType = "gitlab" TokenTypeGitLab TokenType = "gitlab"
// TokenTypeGitea defines gitea as type of the token // TokenTypeGitea defines gitea as type of the token.
TokenTypeGitea TokenType = "gitea" TokenTypeGitea TokenType = "gitea"
) )
// Context carries along some data through the pipes // Context carries along some data through the pipes.
type Context struct { type Context struct {
ctx.Context ctx.Context
Config config.Project Config config.Project
@ -85,7 +85,7 @@ type Context struct {
Semver Semver Semver Semver
} }
// Semver represents a semantic version // Semver represents a semantic version.
type Semver struct { type Semver struct {
Major uint64 Major uint64
Minor uint64 Minor uint64
@ -94,18 +94,18 @@ type Semver struct {
Prerelease string Prerelease string
} }
// New context // New context.
func New(config config.Project) *Context { func New(config config.Project) *Context {
return Wrap(ctx.Background(), config) return Wrap(ctx.Background(), config)
} }
// NewWithTimeout new context with the given timeout // NewWithTimeout new context with the given timeout.
func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc) { func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc) {
ctx, cancel := ctx.WithTimeout(ctx.Background(), timeout) ctx, cancel := ctx.WithTimeout(ctx.Background(), timeout)
return Wrap(ctx, config), cancel return Wrap(ctx, config), cancel
} }
// Wrap wraps an existing context // Wrap wraps an existing context.
func Wrap(ctx ctx.Context, config config.Project) *Context { func Wrap(ctx ctx.Context, config config.Project) *Context {
return &Context{ return &Context{
Context: ctx, Context: ctx,