makefile: added megacheck
This commit is contained in:
@@ -23,6 +23,7 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- make get-deps
|
- make get-deps
|
||||||
|
- make get-tools
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make
|
- make
|
||||||
|
|||||||
33
Makefile
33
Makefile
@@ -1,7 +1,7 @@
|
|||||||
all: check test integration-test
|
all: check test integration-test
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: .check-fmt .check-vet .check-lint .check-misspell .check-ineffassign
|
check: .check-fmt .check-vet .check-lint .check-ineffassign .check-mega .check-misspell
|
||||||
|
|
||||||
.PHONY: .check-fmt
|
.PHONY: .check-fmt
|
||||||
.check-fmt:
|
.check-fmt:
|
||||||
@@ -15,14 +15,18 @@ check: .check-fmt .check-vet .check-lint .check-misspell .check-ineffassign
|
|||||||
.check-lint:
|
.check-lint:
|
||||||
@golint -set_exit_status ./...
|
@golint -set_exit_status ./...
|
||||||
|
|
||||||
.PHONY: .check-misspell
|
|
||||||
.check-misspell:
|
|
||||||
@misspell ./...
|
|
||||||
|
|
||||||
.PHONY: .check-ineffassign
|
.PHONY: .check-ineffassign
|
||||||
.check-ineffassign:
|
.check-ineffassign:
|
||||||
@ineffassign .
|
@ineffassign .
|
||||||
|
|
||||||
|
.PHONY: .check-mega
|
||||||
|
.check-mega:
|
||||||
|
@megacheck ./...
|
||||||
|
|
||||||
|
.PHONY: .check-misspell
|
||||||
|
.check-misspell:
|
||||||
|
@misspell ./...
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
@go test -cover -race ./...
|
@go test -cover -race ./...
|
||||||
@@ -35,6 +39,19 @@ integration-test:
|
|||||||
get-deps:
|
get-deps:
|
||||||
go get -t ./...
|
go get -t ./...
|
||||||
|
|
||||||
go get -u github.com/golang/lint/golint
|
ifndef GOBIN
|
||||||
go get -u github.com/client9/misspell/cmd/misspell
|
export GOBIN := $(GOPATH)/bin
|
||||||
go get -u github.com/gordonklaus/ineffassign
|
endif
|
||||||
|
|
||||||
|
.PHONY: get-tools
|
||||||
|
get-tools: GOPATH := $(shell mktemp -d)
|
||||||
|
get-tools:
|
||||||
|
@echo "==> Installing tools at $(GOBIN)..."
|
||||||
|
@mkdir -p $(GOBIN)
|
||||||
|
|
||||||
|
@go get -u github.com/golang/lint/golint
|
||||||
|
@go get -u github.com/client9/misspell/cmd/misspell
|
||||||
|
@go get -u github.com/gordonklaus/ineffassign
|
||||||
|
@go get -u honnef.co/go/tools/cmd/megacheck
|
||||||
|
|
||||||
|
@rm -Rf $(GOPATH)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
// Use of this source code is governed by a ALv2-style
|
// Use of this source code is governed by a ALv2-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build all integration
|
||||||
|
|
||||||
package gocqlx_test
|
package gocqlx_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -55,10 +55,8 @@ func isScannable(t reflect.Type) bool {
|
|||||||
// it's not important that we use the right mapper for this particular object,
|
// it's not important that we use the right mapper for this particular object,
|
||||||
// we're only concerned on how many exported fields this struct has
|
// we're only concerned on how many exported fields this struct has
|
||||||
m := DefaultMapper
|
m := DefaultMapper
|
||||||
if len(m.TypeMap(t).Index) == 0 {
|
|
||||||
return true
|
return len(m.TypeMap(t).Index) == 0
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fieldsByName fills a values interface with fields from the passed value based
|
// fieldsByName fills a values interface with fields from the passed value based
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ import (
|
|||||||
// BATCH reference:
|
// BATCH reference:
|
||||||
// https://cassandra.apache.org/doc/latest/cql/dml.html#batch
|
// https://cassandra.apache.org/doc/latest/cql/dml.html#batch
|
||||||
|
|
||||||
// builder is interface implemented by other builders.
|
|
||||||
type builder interface {
|
|
||||||
ToCql() (stmt string, names []string)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BatchBuilder builds CQL BATCH statements.
|
// BatchBuilder builds CQL BATCH statements.
|
||||||
type BatchBuilder struct {
|
type BatchBuilder struct {
|
||||||
unlogged bool
|
unlogged bool
|
||||||
|
|||||||
Reference in New Issue
Block a user