open-vault/vault/namespaces.go
Brian Kassouf 303c2aee7c
Run a more strict formatter over the code (#11312)
* Update tooling

* Run gofumpt

* go mod vendor
2021-04-08 09:43:39 -07:00

21 lines
453 B
Go

package vault
import (
"context"
"github.com/hashicorp/vault/helper/namespace"
)
var NamespaceByID func(context.Context, string, *Core) (*namespace.Namespace, error) = namespaceByID
const (
mountTypeNSCubbyhole = "ns_cubbyhole"
)
func namespaceByID(ctx context.Context, nsID string, c *Core) (*namespace.Namespace, error) {
if nsID == namespace.RootNamespaceID {
return namespace.RootNamespace, nil
}
return nil, namespace.ErrNoNamespace
}