mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-06 03:13:48 +02:00
4f7968316f
* feat: lint on specific ci step Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: run on push Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * docs: contributing Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * docs: contributing Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: action Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: lint issues Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: lint issues Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
24 lines
509 B
Go
24 lines
509 B
Go
// Package testlib contains test helpers for goreleaser tests.
|
|
package testlib
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// Mktmp creates a new tempdir, cd into it and provides a back function that
|
|
// cd into the previous directory.
|
|
func Mktmp(tb testing.TB) string {
|
|
tb.Helper()
|
|
folder := tb.TempDir()
|
|
current, err := os.Getwd()
|
|
require.NoError(tb, err)
|
|
require.NoError(tb, os.Chdir(folder))
|
|
tb.Cleanup(func() {
|
|
require.NoError(tb, os.Chdir(current))
|
|
})
|
|
return folder
|
|
}
|