From c99798a5a6a0bac05abf8982fabcbd6ee0e3228d Mon Sep 17 00:00:00 2001 From: Clement Sam Date: Tue, 25 May 2021 01:38:37 +0000 Subject: [PATCH] linting --- commands/release/list/release_list.go | 6 ++++-- commands/release/releaseutils/releaseutils.go | 2 +- commands/release/view/view.go | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/commands/release/list/release_list.go b/commands/release/list/release_list.go index 7950cb3a..ddc0f450 100644 --- a/commands/release/list/release_list.go +++ b/commands/release/list/release_list.go @@ -30,10 +30,12 @@ func NewCmdReleaseList(f *cmdutils.Factory) *cobra.Command { } releaseListCmd.Flags().StringP("tag", "t", "", "Filter releases by tag ") // deprecate in favour of the `release view` command - releaseListCmd.Flags().MarkDeprecated("tag", "use `glab release view ` instead") + _ = releaseListCmd.Flags().MarkDeprecated("tag", "use `glab release view ` instead") + // make it hidden but still accessible // TODO: completely remove before a major release (v2.0.0+) - releaseListCmd.Flags().MarkHidden("tag") + _ = releaseListCmd.Flags().MarkHidden("tag") + return releaseListCmd } diff --git a/commands/release/releaseutils/releaseutils.go b/commands/release/releaseutils/releaseutils.go index f1502a22..afaf873f 100644 --- a/commands/release/releaseutils/releaseutils.go +++ b/commands/release/releaseutils/releaseutils.go @@ -32,7 +32,7 @@ func RenderReleaseAssertLinks(assets []*gitlab.ReleaseLink) string { } t := tableprinter.NewTablePrinter() for _, asset := range assets { - t.AddRow(asset.Name, asset.LinkType, asset.DirectAssetURL) + t.AddRow(asset.Name, asset.DirectAssetURL) //assetsPrint += asset.DirectAssetURL + "\n" } return t.String() diff --git a/commands/release/view/view.go b/commands/release/view/view.go index 788057b3..3c1b20dc 100644 --- a/commands/release/view/view.go +++ b/commands/release/view/view.go @@ -2,6 +2,7 @@ package view import ( "fmt" + "github.com/MakeNowJust/heredoc" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/commands/release/releaseutils" @@ -15,7 +16,7 @@ import ( ) type ViewOpts struct { - TagName string + TagName string OpenInBrowser bool IO *iostreams.IOStreams @@ -84,7 +85,7 @@ func deleteRun(opts *ViewOpts) error { if opts.TagName == "" { tags, resp, err := client.Tags.ListTags(repo.FullName(), &gitlab.ListTagsOptions{ OrderBy: gitlab.String("updated"), - Sort: gitlab.String("desc"), + Sort: gitlab.String("desc"), }) if err != nil && resp != nil && resp.StatusCode != 404 { return cmdutils.WrapError(err, "could not fetch tag") @@ -109,7 +110,7 @@ func deleteRun(opts *ViewOpts) error { repo.FullName(), release.TagName) if opts.IO.IsOutputTTY() { - opts.IO.Logf("Opening %s in your browser.\n", release) + opts.IO.Logf("Opening %s in your browser.\n", url) } browser, _ := cfg.Get(repo.RepoHost(), "browser")