refactor(api module): enforce typed definitions (#2238)

This commit is contained in:
Damian Debkowski authored and GitHub committed 2022-07-21 15:21:31 -07:00
1 parent d6c1402223
commit c2bfcc0664
79 files changed
+906 -551

No files matched your search

+1 -4
View File
@@ -32,10 +32,7 @@ func saveAndOrPrintToken(c *base.Command, result *authmethods.AuthenticateResult
}))
case "json":
if ok := c.PrintJsonItem(&dummyGenericResponse{
item: token,
response: result.GetResponse(),
}); !ok {
if ok := c.PrintJsonItem(result.GetResponse()); !ok {
return base.CommandCliError
}
return base.CommandSuccess
@@ -84,21 +84,6 @@ func (c *PasswordCommand) AutocompleteFlags() complete.Flags {
return c.Flags().Completions()
}
type dummyGenericResponse struct {
item interface{}
response *api.Response
}
var _ api.GenericResult = (*dummyGenericResponse)(nil)
func (d *dummyGenericResponse) GetItem() interface{} {
return d.item
}
func (d *dummyGenericResponse) GetResponse() *api.Response {
return d.response
}
func (c *PasswordCommand) Run(args []string) int {
f := c.Flags()