1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Use modern error handling and enforce it via lint (#1327)

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
6543
2023-02-02 00:08:02 +01:00
committed by GitHub
parent c73b1ecf2a
commit 18d3139e9e
37 changed files with 156 additions and 157 deletions

View File

@@ -16,11 +16,11 @@ func TestSecretAvailable(t *testing.T) {
}
assert.True(t, secret.Available(&yaml.Container{
Image: "golang",
Commands: types.Stringorslice(strslice.StrSlice{"echo 'this is not a plugin'"}),
Commands: types.StringOrSlice(strslice.StrSlice{"echo 'this is not a plugin'"}),
}))
assert.False(t, secret.Available(&yaml.Container{
Image: "not-golang",
Commands: types.Stringorslice(strslice.StrSlice{"echo 'this is not a plugin'"}),
Commands: types.StringOrSlice(strslice.StrSlice{"echo 'this is not a plugin'"}),
}))
// secret only available for "golang" plugin
secret = Secret{
@@ -29,14 +29,14 @@ func TestSecretAvailable(t *testing.T) {
}
assert.True(t, secret.Available(&yaml.Container{
Image: "golang",
Commands: types.Stringorslice(strslice.StrSlice{}),
Commands: types.StringOrSlice(strslice.StrSlice{}),
}))
assert.False(t, secret.Available(&yaml.Container{
Image: "not-golang",
Commands: types.Stringorslice(strslice.StrSlice{}),
Commands: types.StringOrSlice(strslice.StrSlice{}),
}))
assert.False(t, secret.Available(&yaml.Container{
Image: "not-golang",
Commands: types.Stringorslice(strslice.StrSlice{"echo 'this is not a plugin'"}),
Commands: types.StringOrSlice(strslice.StrSlice{"echo 'this is not a plugin'"}),
}))
}