Skip to content

Commit

Permalink
better presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Mar 19, 2017
1 parent d2b4005 commit 725bb04
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Declarations are provided in comments like so:
For valid declarations, `go-sumtype` will look for all occurrences in which a
value of type `MySumType` participates in a type switch statement. In those
occurrences, it will attempt to detect whether the type switch is exhaustive
or not. If it's not, `go-sumtype` will report an error. For example:
or not. If it's not, `go-sumtype` will report an error. For example, running
`go-sumtype` on this source file:

```
$ cat mysumtype.go
```go
package main

//go-sumtype:decl MySumType
Expand All @@ -71,6 +71,11 @@ func main() {
case *VariantA:
}
}
```

produces the following:

```
$ go-sumtype mysumtype.go
mysumtype.go:18:2: exhaustiveness check failed for sum type 'MySumType': missing cases for VariantB
```
Expand Down

0 comments on commit 725bb04

Please sign in to comment.