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

fix: conform to stricter printf usage in Go 1.24#16330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 1 commit intomainfrommafredri/fix-conform-to-go1-24-vet
Jan 29, 2025

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedJan 29, 2025
edited
Loading

This are being auto-fixed by VS Code so I decided to fix them all:

With Go 1.24rc2:

❯ go vet ./...# github.com/coder/coder/v2/pty/ptytest# [github.com/coder/coder/v2/pty/ptytest]pty/ptytest/ptytest.go:255:23: method ReadRune(ctx context.Context) rune should have signature ReadRune() (rune, int, error)# github.com/coder/coder/v2/coderd/httpapi_test# [github.com/coder/coder/v2/coderd/httpapi_test]coderd/httpapi/httpapi_test.go:146:42: non-constant format string in call to github.com/coder/coder/v2/coderd/httpapi.WebsocketCloseSprintfcoderd/httpapi/httpapi_test.go:154:42: non-constant format string in call to github.com/coder/coder/v2/coderd/httpapi.WebsocketCloseSprintf# github.com/coder/coder/v2/vpn# [github.com/coder/coder/v2/vpn]vpn/tunnel.go:75:20: literal copies lock value from *(s): github.com/coder/coder/v2/vpn.speaker[*github.com/coder/coder/v2/vpn.TunnelMessage, *github.com/coder/coder/v2/vpn.ManagerMessage, github.com/coder/coder/v2/vpn.ManagerMessage] contains sync.Mutex# github.com/coder/coder/v2/provisioner/terraform# [github.com/coder/coder/v2/provisioner/terraform]provisioner/terraform/provision.go:81:36: non-constant format string in call to github.com/coder/coder/v2/provisionersdk.PlanErrorfprovisioner/terraform/provision.go:171:36: non-constant format string in call to github.com/coder/coder/v2/provisionersdk.PlanErrorfprovisioner/terraform/provision.go:192:37: non-constant format string in call to github.com/coder/coder/v2/provisionersdk.ApplyErrorf# github.com/coder/coder/v2/coderd/healthcheck# [github.com/coder/coder/v2/coderd/healthcheck]coderd/healthcheck/workspaceproxy.go:103:79: non-constant format string in call to github.com/coder/coder/v2/coderd/healthcheck/health.Messagefcoderd/healthcheck/workspaceproxy.go:105:60: non-constant format string in call to github.com/coder/coder/v2/coderd/healthcheck/health.Errorf# github.com/coder/coder/v2/agent_test# [github.com/coder/coder/v2/agent_test]agent/agent_test.go:980:38: non-constant format string in call to fmt.Sprintf# github.com/coder/coder/v2/cli# [github.com/coder/coder/v2/cli]cli/gitssh.go:95:8: non-constant format string in call to github.com/coder/pretty.Sprintfcli/login.go:212:36: non-constant format string in call to fmt.Fprintfcli/logout.go:71:35: non-constant format string in call to fmt.Fprintfcli/publickey.go:49:5: non-constant format string in call to github.com/coder/coder/v2/cli/cliui.Infofcli/publickey.go:52:28: non-constant format string in call to github.com/coder/coder/v2/cli/cliui.Infofcli/server.go:516:28: non-constant format string in call to github.com/coder/coder/v2/cli/cliui.Infofcli/templateversionarchive.go:79:31: non-constant format string in call to fmt.Sprintfcli/templateversionarchive.go:90:30: non-constant format string in call to fmt.Sprintf# github.com/coder/coder/v2/enterprise/cli# [github.com/coder/coder/v2/enterprise/cli]enterprise/cli/proxyserver.go:208:28: non-constant format string in call to github.com/coder/coder/v2/cli/cliui.Infof

After:

# github.com/coder/coder/v2/pty/ptytest# [github.com/coder/coder/v2/pty/ptytest]pty/ptytest/ptytest.go:256:23: method ReadRune(ctx context.Context) rune should have signature ReadRune() (rune, int, error)# github.com/coder/coder/v2/vpn# [github.com/coder/coder/v2/vpn]vpn/tunnel.go:75:20: literal copies lock value from *(s): github.com/coder/coder/v2/vpn.speaker[*github.com/coder/coder/v2/vpn.TunnelMessage, *github.com/coder/coder/v2/vpn.ManagerMessage, github.com/coder/coder/v2/vpn.ManagerMessage] contains sync.Mutex

These havenolints but thego vet command doesn't care about them.

Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks 👍

}

_,_=fmt.Fprintln(
inv.Stdout,fmt.Sprintf("Version "+pretty.Sprint(cliui.DefaultStyles.Keyword,version.Name)+" "+pastVerb+" at "+cliui.Timestamp(time.Now())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

OMG this is cursed.

mafredri reacted with laugh emoji
@mafredrimafredri merged commit9520da3 intomainJan 29, 2025
37 checks passed
@mafredrimafredri deleted the mafredri/fix-conform-to-go1-24-vet branchJanuary 29, 2025 16:06
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mafredrimafredri

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@mafredri@dannykopping@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp