Navigation Menu

Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: false positive about wrong argument for verb #23552

Closed
marat-rkh opened this issue Jan 25, 2018 · 2 comments
Closed

cmd/vet: false positive about wrong argument for verb #23552

marat-rkh opened this issue Jan 25, 2018 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@marat-rkh
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.9.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Run go vet on the following file:

package main

import "fmt"

type T int

func (t T) String() string { return "t" }

func main() {
	fmt.Printf("%s", [1]T{0})
	fmt.Printf("%s", []T{0})
}

What did you expect to see?

No errors.

What did you see instead?

For the first line go vet reports arg [1]T{0} for printf verb %s of wrong type: [1]main.T. This is false positive as file executes normally and prints [t][t].

@mvdan mvdan self-assigned this Jan 25, 2018
@mvdan mvdan added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 25, 2018
@mvdan mvdan added this to the Go1.11 milestone Jan 25, 2018
@mvdan
Copy link
Member

mvdan commented Jan 25, 2018

Thank you for taking the time to file these!

@gopherbot
Copy link

Change https://golang.org/cl/90455 mentions this issue: cmd/vet: %s is valid for an array of stringer

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.10 Jan 29, 2018
@golang golang locked and limited conversation to collaborators Jan 30, 2019
@rsc rsc unassigned mvdan Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants