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

enable "go vet" checks for parameters #390

Merged
merged 2 commits into from
Oct 23, 2023

Commits on Oct 23, 2023

  1. enable "go vet" checks for parameters

    Adding some dead code which calls fmt.Sprintf/Sprint/Sprintln makes "go vet"
    recognize what kind of parameters the unstructured klog calls
    take (https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/printf#hdr-Analyzer_printf).
    
    Then it can report incorrect calls like:
    
        klog.Infof("%s") // k8s.io/klog/v2.Infof format %s reads arg kubernetes#1, but call has 0 args
        klog.Info("%s", "world") // k8s.io/klog/v2.Info call has possible formatting directive %s
    
    The same does not work for structured calls like klog.InfoS. logcheck needs to
    be used for those.
    pohly committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    b394f4b View commit details
    Browse the repository at this point in the history
  2. testing: bump Go version matrix

    Testing with Go 1.17 gets removed because it does not support "go mod vendor
    -o" and is out of support.
    pohly committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    6af4ad1 View commit details
    Browse the repository at this point in the history