Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit626e923

Browse files
committed
fixup! Add golintci and fix errors
1 parent18ae0da commit626e923

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

‎.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ linters-settings:
1313
funcs:# Run `go tool vet help printf` to see available settings for `printf` analyzer.
1414
-(cdr.dev/coder-cli/internal/clog).Tipf
1515
-(cdr.dev/coder-cli/internal/clog).Hintf
16-
-(cdr.dev/coder-cli/internal/clog).LogDebugf
1716
-(cdr.dev/coder-cli/internal/clog).Causef

‎internal/clog/error.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ func Bold(a string) string {
112112
returncolor.New(color.Bold).Sprint(a)
113113
}
114114

115-
//Tip formats according to the given format specifier and prepends a bolded "tip: " header.
116-
funcTip(formatstring,a...interface{})string {
115+
//Tipf formats according to the given format specifier and prepends a bolded "tip: " header.
116+
funcTipf(formatstring,a...interface{})string {
117117
returnfmt.Sprintf("%s %s",Bold("tip:"),fmt.Sprintf(format,a...))
118118
}
119119

120-
//Hint formats according to the given format specifier and prepends a bolded "hint: " header.
121-
funcHint(formatstring,a...interface{})string {
120+
//Hintf formats according to the given format specifier and prepends a bolded "hint: " header.
121+
funcHintf(formatstring,a...interface{})string {
122122
returnfmt.Sprintf("%s %s",Bold("hint:"),fmt.Sprintf(format,a...))
123123
}
124124

125-
//Cause formats according to the given format specifier and prepends a bolded "cause: " header.
126-
funcCause(formatstring,a...interface{})string {
125+
//Causef formats according to the given format specifier and prepends a bolded "cause: " header.
126+
funcCausef(formatstring,a...interface{})string {
127127
returnfmt.Sprintf("%s %s",Bold("cause:"),fmt.Sprintf(format,a...))
128128
}
129129

‎internal/cmd/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
varerrNeedLogin=clog.Fatal(
1616
"failed to read session credentials",
17-
clog.Hint(`did you run "coder login [https://coder.domain.com]"?`),
17+
clog.Hintf(`did you run "coder login [https://coder.domain.com]"?`),
1818
)
1919

2020
funcnewClient() (*coder.Client,error) {

‎internal/cmd/ceapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ func findEnv(ctx context.Context, client *coder.Client, envName, userEmail strin
7878
"failed to find environment",
7979
fmt.Sprintf("environment %q not found in %q",envName,found),
8080
clog.BlankLine,
81-
clog.Tip("run\"coder envs ls\" to view your environments"),
81+
clog.Tipf("run\"coder envs ls\" to view your environments"),
8282
)
8383
}

‎internal/cmd/envs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ coder envs --user charlie@coder.com ls -o json \
117117
iferr=client.StopEnvironment(cmd.Context(),env.ID);err!=nil {
118118
atomic.AddInt32(&fails,1)
119119
err=clog.Fatal(fmt.Sprintf("stop environment %q",env.Name),
120-
clog.Cause(err.Error()),clog.BlankLine,
121-
clog.Hint("current environment status is %q",env.LatestStat.ContainerStatus),
120+
clog.Causef(err.Error()),clog.BlankLine,
121+
clog.Hintf("current environment status is %q",env.LatestStat.ContainerStatus),
122122
)
123123
clog.Log(err)
124124
returnerr
@@ -186,7 +186,7 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
186186
clog.LogSuccess(
187187
"creating environment...",
188188
clog.BlankLine,
189-
clog.Tip(`run "coder envs watch-build %q" to trail the build logs`,args[0]),
189+
clog.Tipf(`run "coder envs watch-build %q" to trail the build logs`,args[0]),
190190
)
191191

192192
iffollow {
@@ -205,7 +205,7 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
205205
cmd.Flags().IntP("gpus","g",defaultGPUs,"number GPUs an environment should be provisioned with.")
206206
cmd.Flags().StringVarP(&img,"image","i","","ID of the image to base the environment off of.")
207207
cmd.Flags().BoolVar(&follow,"follow",false,"follow buildlog after initiating rebuild")
208-
cmd.MarkFlagRequired("image")
208+
_=cmd.MarkFlagRequired("image")
209209
returncmd
210210
}
211211

@@ -296,7 +296,7 @@ coder envs edit back-end-env --disk 20`,
296296
clog.LogSuccess(
297297
"applied changes to the environment, rebuilding...",
298298
clog.BlankLine,
299-
clog.Tip(`run "coder envs watch-build %q" to trail the build logs`,envName),
299+
clog.Tipf(`run "coder envs watch-build %q" to trail the build logs`,envName),
300300
)
301301
returnnil
302302
},

‎internal/cmd/rebuild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ coder envs rebuild backend-env --force`,
5858
}else {
5959
clog.LogSuccess(
6060
"successfully started rebuild",
61-
clog.Tip("run\"coder envs watch-build %s\" to follow the build logs",env.Name),
61+
clog.Tipf("run\"coder envs watch-build %s\" to follow the build logs",env.Name),
6262
)
6363
}
6464
returnnil

‎internal/cmd/resourcemanager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func printResourceTop(writer io.Writer, groups []groupable, labeler envLabeler,
214214
iflen(userResources)==0 {
215215
clog.LogInfo(
216216
"no groups for the given filters exist with active environments",
217-
clog.Tip("run\"--show-empty\" to see groups with no resources."),
217+
clog.Tipf("run\"--show-empty\" to see groups with no resources."),
218218
)
219219
}
220220
returnnil

‎internal/cmd/shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func networkErr(client *coder.Client, env *coder.Environment) error {
201201
fmt.Sprintf("environment %q is not running",env.Name),
202202
fmt.Sprintf("its current status is %q",env.LatestStat.ContainerStatus),
203203
clog.BlankLine,
204-
clog.Tip("run\"coder envs rebuild %s --follow\" to start the environment",env.Name),
204+
clog.Tipf("run\"coder envs rebuild %s --follow\" to start the environment",env.Name),
205205
)
206206
}
207207
returnxerrors.Errorf("network error, is %q online?",env.Name)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp