Travis: Check for gofmt issues. (#241)

* Travis: Check for gofmt issues.

This will help catch issues like https://github.com/shazow/ssh-chat/pull/240#discussion_r127626103
in CI.

* chat: Fix gofmt issue.
This commit is contained in:
Dmitri Shuralyov 2017-07-17 15:03:55 -04:00 committed by Andrey Petrov
parent e3b5c3712c
commit 50001bf172
2 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ install:
- go get github.com/gordonklaus/ineffassign
script:
- diff -u <(echo -n) <(gofmt -d .)
- ineffassign .
- go vet $(go list ./... | grep -v /vendor/)
- go test -v $(go list ./... | grep -v /vendor/)

View File

@ -3,6 +3,7 @@ package chat
import "regexp"
var reStripName = regexp.MustCompile("[^\\w.-]")
const maxLength = 16
// SanitizeName returns a name with only allowed characters and a reasonable length