Skip to content

mbilski/exhaustivestruct

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

exhaustivestruct

Go Report Card

exhaustivestruct is a go static analysis tool to find structs that have uninitialized fields.

⚠️ This linter is meant to be used only for special cases. It is not recommended to use it for all files in a project.

Installation

go get -u github.com/mbilski/exhaustivestruct/cmd/exhaustivestruct

Usage

Usage: exhaustivestruct [-flag] [package]

Flags:
  -struct_patterns string
      This is a comma separated list of expressions to match struct packages and names

Example

type User struct {
  Name string
  Age int
}

var user = User{ // fails with "Age is missing in User"
  Name: "John",
}