exhaustivestruct

module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2022 License: MIT

README

exhaustivestruct

Cloned from mbilski/exhaustivestruct: a go static analysis tool to find structs that have uninitialized fields.

Changes:

  • Check for private fields in the same package
  • Check for unnamed field initializations

Installation

go get -u github.com/jiping-s/exhaustivestruct/cmd/exhaustivestruct@master

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",
}

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL