diff --git a/acl/policy.go b/acl/policy.go index df4af9c06..5e337f94e 100644 --- a/acl/policy.go +++ b/acl/policy.go @@ -5,9 +5,6 @@ import ( "github.com/hashicorp/hcl" ) -// KeyPolicyType controls the various access levels for keys -type KeyPolicyType string - const ( KeyPolicyDeny = "deny" KeyPolicyRead = "read" @@ -23,7 +20,11 @@ type Policy struct { // KeyPolicy represents a policy for a key type KeyPolicy struct { Prefix string `hcl:",key"` - Policy KeyPolicyType + Policy string +} + +func (k *KeyPolicy) GoString() string { + return fmt.Sprintf("%#v", *k) } // Parse is used to parse the specified ACL rules into an diff --git a/acl/policy_test.go b/acl/policy_test.go index 35f322e6a..6db3317c0 100644 --- a/acl/policy_test.go +++ b/acl/policy_test.go @@ -46,7 +46,7 @@ key "foo/bar/baz" { t.Fatalf("err: %v", err) } - if reflect.DeepEqual(out, exp) { - t.Fatalf("bad: %#v", out) + if !reflect.DeepEqual(out, exp) { + t.Fatalf("bad: %#v %#v", out, exp) } }