From 05a295f267ce7df0fd5c6e028bc1bfa5bf7a2b7e Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 7 Dec 2016 16:26:04 -0500 Subject: [PATCH] test: discovered vet issue, masked by tags Signed-off-by: Vincent Batts --- Makefile | 19 +++++++++++++------ unvis_go.go | 6 ++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ab8a130..b80448f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ BUILD := gomtree CWD := $(shell pwd) SOURCE_FILES := $(shell find . -type f -name "*.go") CLEAN_FILES := *~ +TAGS := cvis default: build validation @@ -18,24 +19,30 @@ CLEAN_FILES += .test .test.tags go test -v ./... && touch $@ .test.tags: $(SOURCE_FILES) - go test -tags govis -v ./... && touch $@ + for tag in $(TAGS) ; do go test -tags $$tag -v ./... ; done && touch $@ .PHONY: lint -lint: .lint +lint: .lint .lint.tags -CLEAN_FILES += .lint +CLEAN_FILES += .lint .lint.tags .lint: $(SOURCE_FILES) golint -set_exit_status ./... && touch $@ -.PHONY: vet -vet: .vet +.lint.tags: $(SOURCE_FILES) + for tag in $(TAGS) ; do golint -set_exit_status -tags $$tag -v ./... ; done && touch $@ -CLEAN_FILES += .vet +.PHONY: vet +vet: .vet .vet.tags + +CLEAN_FILES += .vet .vet.tags .vet: $(SOURCE_FILES) go vet ./... && touch $@ +.vet.tags: $(SOURCE_FILES) + for tag in $(TAGS) ; do go vet -tags $$tag -v ./... ; done && touch $@ + .PHONY: cli.test cli.test: .cli.test diff --git a/unvis_go.go b/unvis_go.go index e504f65..6287e48 100644 --- a/unvis_go.go +++ b/unvis_go.go @@ -206,12 +206,10 @@ func unvisRune(dst *[]byte, r rune, s *state, flags VisFlag) error { } *s = stateGround return unvisValid - default: - *s = stateGround - return unvisErrSynbad } - return nil + *s = stateGround + return unvisErrSynbad } type state int