From 7d49ec0a4f3c043a0b9a6dd3be1a99a983a773de Mon Sep 17 00:00:00 2001 From: Oliver Steele Date: Sat, 26 Jun 2021 15:24:21 +0800 Subject: [PATCH] Enable gofmt linter --- .golangci.yml | 3 +++ Makefile | 3 +++ engine_test.go | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 90f1909..040f5ff 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,3 +7,6 @@ issues: # go generate introduces these - path: expressions/scanner.go linters: [deadcode, unused, varcheck] +linters: + enable: + - gofmt diff --git a/Makefile b/Makefile index 5147083..0ad73a8 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ coverage: ## test the package, with coverage deps: ## list dependencies @go list -f '{{join .Deps "\n"}}' ./... | grep -v `go list -f '{{.ImportPath}}'` | grep '\.' | sort | uniq +format: ## list dependencies + @go fmt + generate: ## re-generate lexers and parser go generate ./... diff --git a/engine_test.go b/engine_test.go index fc86254..f9c3079 100644 --- a/engine_test.go +++ b/engine_test.go @@ -42,8 +42,8 @@ func TestEngine_ParseAndRenderString(t *testing.T) { func TestEngine_ParseAndRenderString_ptr_to_hash(t *testing.T) { params := map[string]interface{}{ "message": &map[string]interface{}{ - "Text": "hello", - "jsonNumber" : json.Number("123"), + "Text": "hello", + "jsonNumber": json.Number("123"), }, } engine := NewEngine()