🚨 A bunch of small improvements from linter

This commit is contained in:
Dan Jones 2025-03-19 18:05:16 -05:00
commit 8f02956ecd
10 changed files with 51 additions and 47 deletions

View file

@ -7,6 +7,8 @@ import (
"github.com/stretchr/testify/assert"
)
var errTest = errors.New("sorry")
func TestMake(t *testing.T) {
genOpt := WithGenerator(func(*Config) (string, error) { return "abc", nil })
testcases := []struct {
@ -48,11 +50,10 @@ func TestMake(t *testing.T) {
}
func TestMakeErr(t *testing.T) {
retErr := errors.New("oops")
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", retErr }))
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", errTest }))
st, err := Make(conf)
assert.Zero(t, st)
assert.ErrorIs(t, err, retErr)
assert.ErrorIs(t, err, errTest)
}
func TestMakeDoesntChangeConf(t *testing.T) {