From 8d5a611ce9df84c6f433e6e79e5fdeb32cc7f144 Mon Sep 17 00:00:00 2001 From: Carlos Roberto Date: Tue, 19 Oct 2021 16:49:07 -0300 Subject: [PATCH] refactor: form to json --- .vscode/launch.json | 7 ------- tsuru/client/auth.go | 3 --- tsuru/client/permission.go | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 5c7247b40..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [] -} \ No newline at end of file diff --git a/tsuru/client/auth.go b/tsuru/client/auth.go index 6acba8fad..2c17f1ed3 100644 --- a/tsuru/client/auth.go +++ b/tsuru/client/auth.go @@ -74,16 +74,13 @@ func (c *UserCreate) Run(ctx *cmd.Context, client *cmd.Client) error { if err != nil { return err } - if response != nil { if response.StatusCode == http.StatusNotFound || response.StatusCode == http.StatusMethodNotAllowed { return errors.New("User creation is disabled.") } } - err = cmd.StreamJSONResponse(ctx.Stdout, response) - if err != nil { return err } diff --git a/tsuru/client/permission.go b/tsuru/client/permission.go index 05aed14a6..866d63c27 100644 --- a/tsuru/client/permission.go +++ b/tsuru/client/permission.go @@ -618,7 +618,7 @@ func (c *RoleDefaultRemove) Run(context *cmd.Context, client *cmd.Client) error } encodedParams := params.Encode() if encodedParams == "" { - return fmt.Errorf("You must choose which event to remove default roles.") + return fmt.Errorf("You must choose which event to remove default roles") } addr, err := cmd.GetURL(fmt.Sprintf("/role/default?%s", encodedParams)) if err != nil {