Add make target for 'go generate'

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2022-08-10 09:57:35 +00:00
parent 2e1e2e784a
commit 8e030df089
2 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,7 @@ endif
IMAGE_TAG ?= $(GOLANG_VERSION)
BUILDIMAGE ?= $(IMAGE):$(IMAGE_TAG)-devel
TARGETS := binary build all check fmt assert-fmt lint vet test
TARGETS := binary build all check fmt assert-fmt generate lint vet test
DOCKER_TARGETS := $(patsubst %, docker-%, $(TARGETS))
.PHONY: $(TARGETS) $(DOCKER_TARGETS)
@ -54,6 +54,9 @@ assert-fmt:
rm fmt.out; \
fi
generate:
go generate $(MODULE)/...
lint:
# We use `go list -f '{{.Dir}}' $(MODULE)/...` to skip the `vendor` folder.
go list -f '{{.Dir}}' $(MODULE)/... | xargs golint -set_exit_status

View File

@ -15,3 +15,4 @@ ARG GOLANG_VERSION=1.16
FROM golang:${GOLANG_VERSION}
RUN go get -u golang.org/x/lint/golint
RUN go install github.com/matryer/moq@latest