Skip to content

Commit

Permalink
docs: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Mar 20, 2022
1 parent 13dbb26 commit c73fb34
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
#### The "why?"

There is a similar linter [exhaustivestruct](https://github.com/mbilski/exhaustivestruct), but it is abandoned and not
optimal.
This linter can be called a successor of `exhaustivestruct`, but is at least **2.5+ times faster**, due to better
algorithm and can receive regular expressions as `include` and/or `exclude` patterns, while `exhaustivestruct`
only receive inclusion patterns (and even they are not RegExp).
optimal.

This linter can be called a successor of `exhaustivestruct`, and:

- it is at least **2.5+ times faster**, due to better algorithm;
- can receive `include` and/or `exclude` patterns;
- expects received patterns to be RegExp, therefore this package is not api-compatible with `exhaustivestruct`.

### Installation

Expand Down Expand Up @@ -42,21 +45,22 @@ package a

type Shape struct {
Length int
Width int
Width int

volume int
}

// valid
var a Shape = Shape{
Length: 5,
Width: 3,
Length: 5,
Width: 3,
volume: 5,
}

// invalid, `volume` is missing
var b Shape = Shape{
Length: 5,
Width: 3,
Width: 3,
}

// Package b.go
Expand All @@ -67,7 +71,7 @@ import "a"
// valid
var b Shape = a.Shape{
Length: 5,
Width: 3,
Width: 3,
}

// invalid, `Width` is missing
Expand Down

0 comments on commit c73fb34

Please sign in to comment.