Backend() functions should return 'backend' objects.

If they return pointers to 'framework.Backend' objects, the receiver functions can't be tested.
This commit is contained in:
vishalnayak
2016-06-10 15:53:02 -04:00
parent 117200c88a
commit cfe0aa860e
9 changed files with 18 additions and 18 deletions

View File

@@ -12,7 +12,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Map = &framework.PolicyMap{
PathMap: framework.PathMap{
@@ -37,7 +37,7 @@ func Backend() *framework.Backend {
AuthRenew: b.pathLoginRenew,
}
return b.Backend
return &b
}
type backend struct {