Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haya14busa/gosum
Sum/Union/Variant Type in Go and Static Check Tool of switch-case handling
https://github.com/haya14busa/gosum
go golang
Last synced: 22 days ago
JSON representation
Sum/Union/Variant Type in Go and Static Check Tool of switch-case handling
- Host: GitHub
- URL: https://github.com/haya14busa/gosum
- Owner: haya14busa
- License: mit
- Created: 2016-12-04T15:44:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-05T01:30:57.000Z (about 7 years ago)
- Last Synced: 2024-10-03T12:23:09.599Z (about 1 month ago)
- Topics: go, golang
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 44
- Watchers: 6
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Sum/Union/Variant Type in Go and Static Check Tool of switch-case handling
[![GoDoc](https://godoc.org/github.com/haya14busa/gosum?status.svg)](https://godoc.org/github.com/haya14busa/gosum)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)## gosumcheck
### Installation
```
$ go get -u github.com/haya14busa/gosum/cmd/gosumcheck
```### Example
```
$ gosumcheck go/ast/...
/usr/lib/go/src/go/ast/commentmap.go:233:3: uncovered cases for ast.Node type switch:
- *ast.ChanType
- *ast.Ident
- *ast.SelectorExpr
- *ast.TypeAssertExpr
- *ast.CompositeLit
- *ast.FieldList
- *ast.Package
- *ast.ArrayType
- *ast.ParenExpr
- *ast.BinaryExpr
- *ast.UnaryExpr
- *ast.BadExpr
- *ast.FuncLit
- *ast.CommentGroup
- *ast.IndexExpr
- *ast.MapType
- *ast.StructType
- *ast.BasicLit
- *ast.Ellipsis
- *ast.InterfaceType
- *ast.Comment
- *ast.FuncType
- *ast.SliceExpr
- *ast.StarExpr
- *ast.CallExpr
- *ast.KeyValueExpr
/usr/lib/go/src/go/ast/filter.go:158:2: uncovered cases for ast.Spec type switch:
- *ast.ImportSpec
/usr/lib/go/src/go/ast/filter.go:209:2: uncovered cases for ast.Decl type switch:
- *ast.BadDecl
```See `gosumcheck -h` and [Sum/Union/Variant Type in Go and Static Check Tool of switch-case handling](https://medium.com/@haya14busa/sum-union-variant-type-in-go-and-static-check-tool-of-switch-case-handling-3bfc61618b1e) for detail.