Skip to content

Commit ce99d58

Browse files
author
Nishanth Shanmugham
committed
add import path in readme example
1 parent fe289f6 commit ce99d58

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# exhaustive [![Godoc][godoc-svg]][repo]
1+
# exhaustive [![Godoc][godoc-svg]][godoc]
22

33
Package exhaustive defines an analyzer that checks exhaustiveness of switch
44
statements of enum-like constants in Go source code. The analyzer can be
@@ -30,7 +30,7 @@ exhaustive [flags] [packages]
3030
Given the enum:
3131

3232
```go
33-
package token
33+
package token // import "example.org/token"
3434

3535
type Token int
3636

@@ -46,9 +46,9 @@ const (
4646
and code that switches on the enum:
4747

4848
```go
49-
package calc
49+
package calc // import "example.org/calc"
5050

51-
import "token"
51+
import "example.org/token"
5252

5353
func f(t token.Token) {
5454
switch t {
@@ -69,7 +69,7 @@ var m = map[token.Token]string{
6969
running `exhaustive` with default options will print:
7070

7171
```
72-
$ exhaustive
72+
$ exhaustive example.org/calc/...
7373
calc.go:6:2: missing cases in switch of type token.Token: token.Quotient, token.Remainder
7474
$
7575
```
@@ -78,7 +78,7 @@ To additionally check exhaustiveness of map literal keys, use
7878
`-check=switch,map`:
7979

8080
```
81-
$ exhaustive -check=switch,map
81+
$ exhaustive -check=switch,map example.org/calc/...
8282
calc.go:6:2: missing cases in switch of type token.Token: token.Quotient, token.Remainder
8383
calc.go:14:9: missing keys in map of key type token.Token: token.Quotient, token.Remainder
8484
$
@@ -89,7 +89,7 @@ $
8989
Issues and changes are welcome. Please discuss substantial changes
9090
in an issue first.
9191

92-
[repo]: https://pkg.go.dev/github.com/nishanths/exhaustive
92+
[godoc]: https://pkg.go.dev/github.com/nishanths/exhaustive
9393
[godoc-svg]: https://pkg.go.dev/badge/github.com/nishanths/exhaustive.svg
9494
[godoc-doc]: https://pkg.go.dev/github.com/nishanths/exhaustive#section-documentation
9595
[xanalysis]: https://pkg.go.dev/golang.org/x/tools/go/analysis

testdata/xxx/calc/calc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package calc
22

3-
import "github.com/nishanths/exhaustive/testdata/playground/token"
3+
import "github.com/nishanths/exhaustive/testdata/xxx/token"
44

55
func f(t token.Token) {
66
switch t {

0 commit comments

Comments
 (0)