Skip to content
Snippets Groups Projects
Commit 31bb782e authored by Steven Allen's avatar Steven Allen
Browse files

fix code-climate issues


License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 61b1d2f2
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,8 @@ func (me *MarshalerEncoder) Encode(v interface{}) error {
return err
}
// OldContext tries to cast the environment as a legacy command context,
// returning nil on failure.
func OldContext(env interface{}) *oldcmds.Context {
ctx, ok := env.(*oldcmds.Context)
if !ok {
......
......@@ -134,10 +134,14 @@ func commandsOption(cctx oldcmds.Context, command *cmds.Command) ServeOption {
}
}
// CommandsOption constructs a ServerOption for hooking the commands into the
// HTTP server.
func CommandsOption(cctx oldcmds.Context) ServeOption {
return commandsOption(cctx, corecommands.Root)
}
// CommandsOption constructs a ServerOption for hooking the read-only commands
// into the HTTP server.
func CommandsROOption(cctx oldcmds.Context) ServeOption {
return commandsOption(cctx, corecommands.RootRO)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment