Assertion fix in config key generation (#6902)
This commit is contained in:
parent
ec5bafc3e2
commit
3b009c1266
|
@ -32,6 +32,7 @@ func TestPrettyKeyForProject(t *testing.T) {
|
|||
|
||||
assert.Equal(t, "foo", prettyKeyForProject(config.MustMakeKey("test-package", "foo"), proj))
|
||||
assert.Equal(t, "other-package:bar", prettyKeyForProject(config.MustMakeKey("other-package", "bar"), proj))
|
||||
assert.Panics(t, func() { config.MustMakeKey("other:package", "bar") })
|
||||
}
|
||||
|
||||
func TestSecretDetection(t *testing.T) {
|
||||
|
|
|
@ -31,7 +31,7 @@ type Key struct {
|
|||
|
||||
// MustMakeKey constructs a config.Key for a given namespace and name. The namespace may not contain a `:`
|
||||
func MustMakeKey(namespace string, name string) Key {
|
||||
contract.Requiref(!strings.Contains(":", namespace), "namespace", "may not contain a colon")
|
||||
contract.Requiref(!strings.Contains(namespace, ":"), "namespace", "may not contain a colon")
|
||||
return Key{namespace: namespace, name: name}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue