Skip to content

Commit

Permalink
Rename j
Browse files Browse the repository at this point in the history
  • Loading branch information
kradalby committed Feb 12, 2022
1 parent c73b57e commit e18078d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/headscale/cli/utils.go
Expand Up @@ -438,21 +438,21 @@ func getHeadscaleCLIClient() (context.Context, v1.HeadscaleServiceClient, *grpc.
}

func SuccessOutput(result interface{}, override string, outputFormat string) {
var j []byte
var jsonBytes []byte
var err error
switch outputFormat {
case "json":
j, err = json.MarshalIndent(result, "", "\t")
jsonBytes, err = json.MarshalIndent(result, "", "\t")
if err != nil {
log.Fatal().Err(err)
}
case "json-line":
j, err = json.Marshal(result)
jsonBytes, err = json.Marshal(result)
if err != nil {
log.Fatal().Err(err)
}
case "yaml":
j, err = yaml.Marshal(result)
jsonBytes, err = yaml.Marshal(result)
if err != nil {
log.Fatal().Err(err)
}
Expand All @@ -464,7 +464,7 @@ func SuccessOutput(result interface{}, override string, outputFormat string) {
}

//nolint
fmt.Println(string(j))
fmt.Println(string(jsonBytes))
}

func ErrorOutput(errResult error, override string, outputFormat string) {
Expand Down

0 comments on commit e18078d

Please sign in to comment.