Skip to content

Commit 91826ac

Browse files
committed
chore(edge): fix review comments
relates to STACKITCLI-357
1 parent 283abf6 commit 91826ac

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

internal/cmd/beta/edge/token/create/create.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *edge.APICli
185185

186186
// Output result based on the configured output format
187187
func outputResult(p *print.Printer, outputFormat string, token *edge.Token) error {
188-
if token == nil {
189-
// This is only to prevent nil pointer deref.
190-
// As long as the API behaves as defined by it's spec, instance can not be empty (HTTP 200 with an empty body)
191-
return fmt.Errorf("no token returned from the API")
192-
}
193-
194188
return p.OutputResult(outputFormat, token, func() error {
189+
if token == nil {
190+
// This is only to prevent nil pointer deref.
191+
// As long as the API behaves as defined by it's spec, instance can not be empty (HTTP 200 with an empty body)
192+
return fmt.Errorf("no token returned from the API")
193+
}
194+
195195
p.Outputln(token.Token)
196196
return nil
197197
})

0 commit comments

Comments
 (0)