Go Check

Run go vet to analyze Go source code for suspicious constructs

controlplaneio-fluxcd Updated

File contents

Go Check

Use go vet to examine Go source code and report suspicious constructs that the compiler might not catch.

Usage

To vet the current package:

go vet ./...

To vet a specific package:

go vet ./pkg/mypackage

Common Options

  • -v — verbose output, listing checked files
  • -json — output diagnostics in JSON format
  • -vettool=path — use an external vet tool

Analyzers

go vet runs several built-in analyzers including:

  • printf — check printf-style format strings
  • shadow — check for shadowed variables
  • structtag — check struct field tags conform to reflect.StructTag.Get
  • unusedresult — check for unused results of calls to certain functions

controlplaneio-fluxcd/flux-operator/tree/main/config/testdata/skills/go-check commit 0f4ae3f829

Frequently asked questions

npx skillmds@latest add controlplaneio-fluxcd/go-check