Skip to content

govet can produce false-positive without running go install first #17

Closed
@shuLhan

Description

@shuLhan

Environment

  • Go v1.10.2
  • Golangci-lint v1.2.1

Reproduction Steps

  • Create Go file with the following content,
package main

import "fmt"

func main() {
	format := fmt.Sprintf("%%-%ds %%s", 20)
	fmt.Println("format:", format)
	fmt.Printf(format+"\n", "golangci-lint", "test")
}
  • Run golangci-lint run

Expected Result

Congrats! No issues were found.

Actual Result

master ms 0 % golangci-lint run ./...
Run this tool in cloud on every github pull request in https://golangci.com for free (public repos)
govet.go:8: Printf call has arguments but no formatting directives (govet)
        fmt.Printf(format+"\n", "golangci-lint", "test")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions