Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lint): add gometalinter #29

Merged
merged 1 commit into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ go:

before_install:
- go get github.com/mattn/goveralls
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install

script:
- gometalinter --config=config.json ./...
- goveralls -service=travis-ci
19 changes: 19 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Vendor": false,
"DisableAll": true,
"Enable": [
"vet",
"gotype",
"safesql",
"staticcheck",
"errcheck",
"goconst",
"goimports",
"varcheck",
"gas",
"unconvert",
"misspell",
"deadcode",
"unconvert"
]
}
2 changes: 1 addition & 1 deletion router/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (p *Progeny) AddRouter(router Router) {
p.PathRouter = router
}
default:
panic(fmt.Sprintf("unknwon router kind: %s", router.Kind()))
panic(fmt.Sprintf("unknown router kind: %s", router.Kind()))
}
}

Expand Down
2 changes: 1 addition & 1 deletion router/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Index struct {
Pos int
}

// RegexpNode contains infomation for matching a regexp segment.
// RegexpNode contains information for matching a regexp segment.
type RegexpNode struct {
Handler
Progeny
Expand Down
2 changes: 1 addition & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func Split(path string) ([]string, error) {
return result, nil
}

// Segment contains infomation to construct a router.
// Segment contains information to construct a router.
type Segment struct {
// Match is the target string.
Match string
Expand Down