From ef725ad1556cca0dda37967bd277b606017a8a8a Mon Sep 17 00:00:00 2001 From: zhengjiajie Date: Fri, 14 Sep 2018 12:38:34 +0800 Subject: [PATCH] fmt code --- cmd/climc/shell/res_results.go | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/cmd/climc/shell/res_results.go b/cmd/climc/shell/res_results.go index e5402b220c..7ad971e1f9 100644 --- a/cmd/climc/shell/res_results.go +++ b/cmd/climc/shell/res_results.go @@ -8,13 +8,13 @@ import ( ) func init() { - + type ResResultsListOptions struct { options.BaseListOptions - StatMonth string `"help":"stat_month of the query"` - StartDate string `"help":"start_date of the query"` - EndDate string `"help":"end_date of the query"` - ProjectId string `"help":"project_id of the query"` + StatMonth string `"help":"stat_month of the query"` + StartDate string `"help":"start_date of the query"` + EndDate string `"help":"end_date of the query"` + ProjectId string `"help":"project_id of the query"` } R(&ResResultsListOptions{}, "resresult-list", "List all res results ", func(s *mcclient.ClientSession, args *ResResultsListOptions) error { var params *jsonutils.JSONDict @@ -27,7 +27,6 @@ func init() { } } - if len(args.StatMonth) > 0 { params.Add(jsonutils.NewString(args.StatMonth), "stat_month") } @@ -50,26 +49,25 @@ func init() { return nil }) - type ResResultUpdateOptions struct { - ID string `help:"ID of the query"` - StatMonth string `"help":"stat_month of the query"` - StartDate string `"help":"start_date of the query"` - EndDate string `"help":"end_date of the query"` - ProjectId string `"help":"project_id of the query"` + ID string `help:"ID of the query"` + StatMonth string `"help":"stat_month of the query"` + StartDate string `"help":"start_date of the query"` + EndDate string `"help":"end_date of the query"` + ProjectId string `"help":"project_id of the query"` - ItemKey string `"help":"item_key of the query"` - ItemText string `"help":"item_text of the query"` + ItemKey string `"help":"item_key of the query"` + ItemText string `"help":"item_text of the query"` } R(&ResResultUpdateOptions{}, "resresult-export", "Update a resresult export", func(s *mcclient.ClientSession, args *ResResultUpdateOptions) error { params := jsonutils.NewDict() if len(args.StatMonth) > 0 { - params.Add(jsonutils.NewString(args.StatMonth), "stat_month") - } + params.Add(jsonutils.NewString(args.StatMonth), "stat_month") + } - if len(args.StartDate) > 0 { - params.Add(jsonutils.NewString(args.StartDate), "start_date") - } + if len(args.StartDate) > 0 { + params.Add(jsonutils.NewString(args.StartDate), "start_date") + } if len(args.EndDate) > 0 { params.Add(jsonutils.NewString(args.EndDate), "end_date") }