File tree Expand file tree Collapse file tree
internal/cmd/service-account/key/create Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,14 +86,16 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
8686 return fmt .Errorf ("create service account key: %w" , err )
8787 }
8888
89- params .Printer .Outputf ("Created key for service account %s with ID %q\n " , model .ServiceAccountEmail , resp .Id )
90-
91- key , err := json .MarshalIndent (resp , "" , " " )
92- if err != nil {
93- return fmt .Errorf ("marshal key: %w" , err )
94- }
95- params .Printer .Outputln (string (key ))
96- return nil
89+ return params .Printer .OutputResult (model .OutputFormat , resp , func () error {
90+ params .Printer .Outputf ("Created key for service account %s with ID %q\n " , model .ServiceAccountEmail , resp .Id )
91+
92+ key , err := json .MarshalIndent (resp , "" , " " )
93+ if err != nil {
94+ return fmt .Errorf ("marshal key: %w" , err )
95+ }
96+ params .Printer .Outputln (string (key ))
97+ return nil
98+ })
9799 },
98100 }
99101
You can’t perform that action at this time.
0 commit comments