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

refactor(test): use testing.TB Cleanup and Tempdir (#1945)

* refactor: use t.Cleanup instead of defer

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

* refactor: use t.Cleanup instead of defer

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

* refactor: use t.Cleanup instead of defer

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

* refactor: use t.Cleanup instead of defer

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

* fix: filepath

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2020-12-12 13:27:35 -03:00
committed by GitHub
parent 4c3e3933a8
commit 92f52ac406
42 changed files with 270 additions and 560 deletions

View File

@ -122,8 +122,7 @@ func TestPipe_PublishExtraFiles(t *testing.T) {
func pipePublish(t *testing.T, extra []config.ExtraFile) {
gcloudCredentials, _ := filepath.Abs("./testdata/credentials.json")
folder, err := ioutil.TempDir("", "goreleasertest")
require.NoError(t, err)
var folder = t.TempDir()
tgzpath := filepath.Join(folder, "bin.tar.gz")
debpath := filepath.Join(folder, "bin.deb")
require.NoError(t, ioutil.WriteFile(tgzpath, []byte("fake\ntargz"), 0744))