Skip to content

Commit f5b6927

Browse files
authored
1 parent 2e2340a commit f5b6927

13 files changed

Lines changed: 49 additions & 36 deletions

File tree

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/OctopusDeploy/cli
22

3-
go 1.23.12
3+
go 1.25.4
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -21,7 +21,7 @@ require (
2121
github.com/spf13/viper v1.14.0
2222
github.com/stretchr/testify v1.8.4
2323
golang.org/x/exp v0.0.0-20230129154200-a960b3787bd2
24-
golang.org/x/term v0.34.0
24+
golang.org/x/term v0.37.0
2525
)
2626

2727
require (
@@ -53,10 +53,10 @@ require (
5353
github.com/spf13/cast v1.5.0 // indirect
5454
github.com/spf13/jwalterweatherman v1.1.0 // indirect
5555
github.com/subosito/gotenv v1.4.1 // indirect
56-
golang.org/x/crypto v0.41.0 // indirect
57-
golang.org/x/net v0.43.0 // indirect
58-
golang.org/x/sys v0.35.0 // indirect
59-
golang.org/x/text v0.28.0 // indirect
56+
golang.org/x/crypto v0.45.0 // indirect
57+
golang.org/x/net v0.47.0 // indirect
58+
golang.org/x/sys v0.38.0 // indirect
59+
golang.org/x/text v0.31.0 // indirect
6060
gopkg.in/ini.v1 v1.67.0 // indirect
6161
gopkg.in/yaml.v2 v2.4.0 // indirect
6262
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
279279
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
280280
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
281281
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
282+
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
283+
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
282284
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
283285
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
284286
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -349,6 +351,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
349351
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
350352
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
351353
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
354+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
355+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
352356
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
353357
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
354358
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -413,10 +417,14 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
413417
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
414418
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
415419
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
420+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
421+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
416422
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
417423
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
418424
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
419425
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
426+
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
427+
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
420428
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
421429
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
422430
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -427,6 +435,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
427435
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
428436
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
429437
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
438+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
439+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
430440
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
431441
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
432442
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

pkg/apiclient/client_factory.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,11 @@ func ValidateMandatoryEnvironment(host string, apiKey string, accessToken string
159159

160160
if isInteractive {
161161
err := GetInteractiveMandatoryEnvironmentErrorMessage()
162-
163-
return fmt.Errorf(err)
162+
return errors.New(err)
164163
}
165164

166165
err := GetNonInteractiveMandatoryEnvironmentErrorMessage()
167-
168-
return fmt.Errorf(err)
166+
return errors.New(err)
169167
}
170168

171169
return nil

pkg/cmd/project/variables/exclude/exclude.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ func excludeRun(opts *ExcludeOptions) error {
112112
}
113113

114114
if !util.SliceContainsAny(project.IncludedLibraryVariableSets, func(item string) bool { return item == targetVariableSet[0].ID }) {
115-
fmt.Fprintf(opts.Out, output.Yellowf("'%s' is not currently included, skipping\n", targetVariableSet[0].Name))
115+
fmt.Fprint(opts.Out, output.Yellowf("'%s' is not currently included, skipping\n", targetVariableSet[0].Name))
116116
} else {
117117
project.IncludedLibraryVariableSets = util.SliceFilter(project.IncludedLibraryVariableSets, func(id string) bool { return id != targetVariableSet[0].ID })
118118
projectModified = true
119-
fmt.Fprintf(opts.Out, output.Cyanf("Removing '%s' library variable set\n", targetVariableSet[0].Name))
119+
fmt.Fprint(opts.Out, output.Cyanf("Removing '%s' library variable set\n", targetVariableSet[0].Name))
120120
}
121121
}
122122

pkg/cmd/project/variables/include/include.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ func includeRun(opts *IncludeOptions) error {
112112
}
113113

114114
if util.SliceContainsAny(project.IncludedLibraryVariableSets, func(item string) bool { return item == targetVariableSet[0].ID }) {
115-
fmt.Fprintf(opts.Out, output.Yellowf("'%s' is already included, skipping\n", targetVariableSet[0].Name))
115+
fmt.Fprint(opts.Out, output.Yellowf("'%s' is already included, skipping\n", targetVariableSet[0].Name))
116116
} else {
117117
project.IncludedLibraryVariableSets = append(project.IncludedLibraryVariableSets, targetVariableSet[0].ID)
118118
projectModified = true
119-
fmt.Fprintf(opts.Out, output.Cyanf("Including '%s' library variable set\n", targetVariableSet[0].Name))
119+
fmt.Fprint(opts.Out, output.Cyanf("Including '%s' library variable set\n", targetVariableSet[0].Name))
120120
}
121121
}
122122

pkg/cmd/projectgroup/view/view.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package view
22

33
import (
44
"fmt"
5-
"github.com/OctopusDeploy/cli/pkg/apiclient"
65
"io"
76
"strings"
87

8+
"github.com/OctopusDeploy/cli/pkg/apiclient"
9+
910
"github.com/MakeNowJust/heredoc/v2"
1011
"github.com/OctopusDeploy/cli/pkg/constants"
1112
"github.com/OctopusDeploy/cli/pkg/factory"
@@ -100,7 +101,7 @@ func viewRun(opts *ViewOptions) error {
100101
Slug: project.Slug,
101102
})
102103
}
103-
104+
104105
return ProjectGroupAsJson{
105106
Id: pg.GetID(),
106107
Name: pg.GetName(),
@@ -116,9 +117,9 @@ func viewRun(opts *ViewOptions) error {
116117
if description == "" {
117118
description = constants.NoDescription
118119
}
119-
120+
120121
url := util.GenerateWebURL(opts.Host, pg.SpaceID, fmt.Sprintf("projects?projectGroupId=%s", pg.GetID()))
121-
122+
122123
return []string{
123124
output.Bold(pg.GetName()),
124125
description,
@@ -149,30 +150,30 @@ type ProjectGroupAsJson struct {
149150

150151
func formatProjectGroupForBasic(opts *ViewOptions, projectGroup *projectgroups.ProjectGroup, projects []*projects.Project) string {
151152
var result strings.Builder
152-
153+
153154
// header
154155
result.WriteString(fmt.Sprintf("%s %s\n", output.Bold(projectGroup.GetName()), output.Dimf("(%s)", projectGroup.GetID())))
155-
156+
156157
// description
157158
if projectGroup.Description == "" {
158159
result.WriteString(fmt.Sprintln(output.Dim(constants.NoDescription)))
159160
} else {
160161
result.WriteString(fmt.Sprintln(output.Dim(projectGroup.Description)))
161162
}
162-
163+
163164
// projects
164-
result.WriteString(fmt.Sprintf(output.Cyan("\nProjects:\n")))
165+
result.WriteString(fmt.Sprint(output.Cyan("\nProjects:\n")))
165166
for _, project := range projects {
166167
result.WriteString(fmt.Sprintf("%s (%s)\n", output.Bold(project.GetName()), project.Slug))
167168
}
168-
169+
169170
// footer with web URL
170171
url := util.GenerateWebURL(opts.Host, projectGroup.SpaceID, fmt.Sprintf("projects?projectGroupId=%s", projectGroup.GetID()))
171172
result.WriteString(fmt.Sprintf("\nView this project group in Octopus Deploy: %s\n", output.Blue(url)))
172-
173+
173174
if opts.flags.Web.Value {
174175
browser.OpenURL(url)
175176
}
176-
177+
177178
return result.String()
178179
}

pkg/cmd/runbook/snapshot/create/create.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"encoding/json"
55
"errors"
66
"fmt"
7+
"os"
8+
79
"github.com/AlecAivazis/survey/v2"
810
"github.com/MakeNowJust/heredoc/v2"
911
"github.com/OctopusDeploy/cli/pkg/cmd"
@@ -24,7 +26,6 @@ import (
2426
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/releases"
2527
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/runbooks"
2628
"github.com/spf13/cobra"
27-
"os"
2829
)
2930

3031
const (
@@ -253,7 +254,7 @@ func createRun(opts *CreateOptions, outputFormat string) error {
253254
if err != nil {
254255
return err
255256
}
256-
fmt.Fprintf(opts.Out, string(data))
257+
fmt.Fprint(opts.Out, string(data))
257258
default:
258259
if opts.Publish.Value {
259260
_, _ = fmt.Fprintf(opts.Out, "\nSuccessfully created and published runbook snapshot '%s' (%s) for runbook '%s'\n", snapshot.Name, snapshot.GetID(), runbook.Name)

pkg/cmd/space/create/create_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package create_test
22

33
import (
44
"fmt"
5+
"testing"
6+
57
"github.com/OctopusDeploy/cli/pkg/cmd"
68
"github.com/OctopusDeploy/cli/pkg/cmd/space/create"
79
"github.com/OctopusDeploy/cli/pkg/output"
@@ -10,7 +12,6 @@ import (
1012
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/teams"
1113
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/users"
1214
"github.com/stretchr/testify/assert"
13-
"testing"
1415
)
1516

1617
func TestPromptMissing_AllOptionsSupplied(t *testing.T) {
@@ -80,7 +81,7 @@ func TestPromptMissing_NoOptionsSupplied(t *testing.T) {
8081
}
8182

8283
func formatUser(user *users.User) string {
83-
return fmt.Sprintf("%s (%s)", user.DisplayName, output.Dimf(user.Username))
84+
return fmt.Sprintf("%s (%s)", user.DisplayName, output.Dim(user.Username))
8485
}
8586

8687
func formatTeam(team *teams.Team) string {

pkg/gitresources/gitResources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ outerLoop:
137137
case "y": // YES these are the git resources they want
138138
break outerLoop
139139
case "?": // help text
140-
_, _ = fmt.Fprintf(stdout, output.FormatDoc(gitResourceGitRefLoopHelpText))
140+
_, _ = fmt.Fprint(stdout, output.FormatDoc(gitResourceGitRefLoopHelpText))
141141
case "u": // undo!
142142
if len(overriddenGitResourceGitRefs) > 0 {
143143
//strip the last override from the list

pkg/machinescommon/web.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package machinescommon
22

33
import (
44
"fmt"
5+
"io"
6+
57
"github.com/OctopusDeploy/cli/pkg/cmd"
68
"github.com/OctopusDeploy/cli/pkg/output"
79
"github.com/OctopusDeploy/cli/pkg/util"
@@ -10,7 +12,6 @@ import (
1012
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/workerpools"
1113
"github.com/pkg/browser"
1214
"github.com/spf13/cobra"
13-
"io"
1415
)
1516

1617
const (
@@ -47,7 +48,7 @@ func DoWebForWorkerPools(workerPool workerpools.IWorkerPool, dependencies *cmd.D
4748
}
4849

4950
func doWeb(url string, description string, out io.Writer, flags *WebFlags) {
50-
link := output.Bluef(url)
51+
link := output.Blue(url)
5152
fmt.Fprintf(out, "View this %s on Octopus Deploy: %s\n", description, link)
5253
if flags.Web.Value {
5354
browser.OpenURL(url)

0 commit comments

Comments
 (0)