Skip to content

Commit

Permalink
fix(go): set up tests for go modules
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <troian.ap@gmail.com>
  • Loading branch information
troian committed May 26, 2024
1 parent 307d4c0 commit fd6d7d0
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 54 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fi

AKASH_DIRENV_SET=1

export TOOLS
export SEMVER
export GOTOOLCHAIN
export GOTOOLCHAIN_SEMVER
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ ifeq (, $(GOTOOLCHAIN))
$(error "GOTOOLCHAIN is not set")
endif

GO_PKG := go
TS_PKG := ts
GO_ROOT := go
TS_ROOT := $(AKASH_TS_ROOT)

GO := GO111MODULE=$(GO111MODULE) go
GO_MOD_NAME := $(shell cd $(GO_PKG); go list -m 2>/dev/null)
GO_MOD_NAME := $(shell cd $(GO_ROOT); go list -m 2>/dev/null)

BUF_VERSION ?= 1.28.1
PROTOC_VERSION ?= 26.1
GOGOPROTO_VERSION ?= $(shell cd $(GO_PKG); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/gogoproto)
GOGOPROTO_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/gogoproto)
PROTOC_GEN_GOCOSMOS_VERSION ?= $(GOGOPROTO_VERSION)
PROTOC_GEN_GO_PULSAR_VERSION ?= $(shell cd $(GO_PKG); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/cosmos-proto)
PROTOC_GEN_GO_VERSION ?= $(shell cd $(GO_PKG); $(GO) list -mod=readonly -m -f '{{ .Version }}' google.golang.org/protobuf)
PROTOC_GEN_GRPC_GATEWAY_VERSION := $(shell cd $(GO_PKG); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
PROTOC_GEN_DOC_VERSION := $(shell cd $(GO_PKG); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/pseudomuto/protoc-gen-doc)
PROTOC_GEN_GO_PULSAR_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/cosmos-proto)
PROTOC_GEN_GO_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' google.golang.org/protobuf)
PROTOC_GEN_GRPC_GATEWAY_VERSION := $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
PROTOC_GEN_DOC_VERSION := $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/pseudomuto/protoc-gen-doc)

PROTOC_GEN_SWAGGER_VERSION := $(PROTOC_GEN_GRPC_GATEWAY_VERSION)
MODVENDOR_VERSION ?= v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions make/codegen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ proto-gen: $(patsubst %, proto-gen-%,$(PROTO_GEN_MODS))

.PHONY: proto-gen-go
proto-gen-go: $(BUF) $(GOGOPROTO) $(PROTOC_GEN_GOCOSMOS) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_GO)
./script/protocgen.sh go $(GO_MOD_NAME) $(GO_PKG)
./script/protocgen.sh go $(GO_MOD_NAME) $(GO_ROOT)

.PHONY: proto-gen-ts
proto-gen-ts: $(BUF) $(AKASH_TS_NODE_MODULES)
Expand All @@ -18,7 +18,7 @@ proto-gen-doc: $(BUF) $(SWAGGER_COMBINE) $(PROTOC_GEN_DOC) $(PROTOC_GEN_SWAGGER)
./script/protocgen.sh doc $(GO_MOD_NAME)

mocks: $(MOCKERY)
(cd $(GO_PKG); $(GO) generate ./...)
(cd $(GO_ROOT); $(GO) generate ./...)

.PHONY: codegen
codegen: proto-gen mocks
Expand Down
4 changes: 2 additions & 2 deletions make/lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ node

.PHONY: lint-go
lint-go: $(GOLANGCI_LINT)
(cd $(GO_PKG); $(GOLANGCI_LINT_RUN) ./... --issues-exit-code=0)
(cd $(GO_ROOT); $(GOLANGCI_LINT_RUN) ./... --issues-exit-code=0)

.PHONY: lint-go-%
lint-go-%: $(GOLANGCI_LINT)
(cd $(GO_PKG); $(GOLINT) $*)
(cd $(GO_ROOT); $(GOLINT) $*)

.PHONY: lint-proto-%
lint-proto-%:
Expand Down
10 changes: 5 additions & 5 deletions make/mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ endef

.PHONY: deps-tidy
deps-tidy:
(cd $(GO_PKG); $(GO) mod tidy)
(cd $(GO_ROOT); $(GO) mod tidy)

.PHONY: deps-vendor
deps-vendor:
(cd $(GO_PKG); go mod vendor)
(cd $(GO_ROOT); go mod vendor)

.PHONY: modsensure
modsensure: deps-tidy deps-vendor
Expand All @@ -31,10 +31,10 @@ modsensure: deps-tidy deps-vendor
modvendor: export VENDOR_BUF:=$(VENDOR_BUF)
modvendor: $(MODVENDOR) modsensure
@echo "vendoring non-go files..."
@(cd $(GO_PKG); \
@(cd $(GO_ROOT); \
$(MODVENDOR) -copy="**/*.proto" -include=k8s.io/apimachinery \
$(MODVENDOR) -copy="**/swagger.yaml" -include=github.com/cosmos/cosmos-sdk/client/docs/swagger-ui \
)
@mkdir -p .cache/include/k8s
ln -snf ../../../$(GO_PKG)/vendor/k8s.io .cache/include/k8s/io
echo "$${VENDOR_BUF}" > $(GO_PKG)/vendor/k8s.io/buf.yaml
ln -snf ../../../$(GO_ROOT)/vendor/k8s.io .cache/include/k8s/io
echo "$${VENDOR_BUF}" > $(GO_ROOT)/vendor/k8s.io/buf.yaml
24 changes: 12 additions & 12 deletions make/setup-cache.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cache: $(AKASH_DEVCACHE)
$(BUF_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing buf v$(BUF_VERSION) ..."
rm -f $(BUF)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/bufbuild/buf/cmd/buf@v$(BUF_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/bufbuild/buf/cmd/buf@v$(BUF_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -47,7 +47,7 @@ $(PROTOC): $(PROTOC_VERSION_FILE)
$(PROTOC_GEN_GOCOSMOS_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing protoc-gen-gocosmos $(PROTOC_GEN_GOCOSMOS_VERSION) ..."
rm -f $(PROTOC_GEN_GOCOSMOS)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/gogoproto/protoc-gen-gocosmos)
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/gogoproto/protoc-gen-gocosmos)
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -56,7 +56,7 @@ $(PROTOC_GEN_GOCOSMOS): $(PROTOC_GEN_GOCOSMOS_VERSION_FILE) #modvendor
$(GOGOPROTO_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing gogoproto $(GOGOPROTO_VERSION) ..."
rm -f $(BUF)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/gogoproto/gogoproto)
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/gogoproto/gogoproto)
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -65,7 +65,7 @@ $(GOGOPROTO): $(GOGOPROTO_VERSION_FILE)
$(PROTOC_GEN_GO_PULSAR_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing protoc-gen-go-pulsar $(PROTOC_GEN_GO_PULSAR_VERSION) ..."
rm -f $(PROTOC_GEN_GO_PULSAR)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@$(PROTOC_GEN_GO_PULSAR_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@$(PROTOC_GEN_GO_PULSAR_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -74,7 +74,7 @@ $(PROTOC_GEN_GO_PULSAR): $(PROTOC_GEN_GO_PULSAR_VERSION_FILE)
$(PROTOC_GEN_GO_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing protoc-gen-go $(PROTOC_GEN_GO_VERSION) ..."
rm -f $(PROTOC_GEN_GO)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -83,7 +83,7 @@ $(PROTOC_GEN_GO): $(PROTOC_GEN_GO_VERSION_FILE)
$(PROTOC_GEN_DOC_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing protoc-gen-doc $(PROTOC_GEN_DOC_VERSION) ..."
rm -f $(PROTOC_GEN_DOC)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@$(PROTOC_GEN_DOC_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@$(PROTOC_GEN_DOC_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -92,7 +92,7 @@ $(PROTOC_GEN_DOC): $(PROTOC_GEN_DOC_VERSION_FILE)
$(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "Installing protoc-gen-grpc-gateway $(PROTOC_GEN_GRPC_GATEWAY_VERSION) ..."
rm -f $(PROTOC_GEN_GRPC_GATEWAY)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@$(PROTOC_GEN_GRPC_GATEWAY_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@$(PROTOC_GEN_GRPC_GATEWAY_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -101,7 +101,7 @@ $(PROTOC_GEN_GRPC_GATEWAY): $(PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE)
$(PROTOC_GEN_SWAGGER_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "Installing protoc-gen-grpc-gateway $(PROTOC_GEN_SWAGGER_VERSION) ..."
rm -f $(PROTOC_GEN_GRPC_GATEWAY)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@$(PROTOC_GEN_SWAGGER_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@$(PROTOC_GEN_SWAGGER_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -110,7 +110,7 @@ $(PROTOC_GEN_SWAGGER): $(PROTOC_GEN_SWAGGER_VERSION_FILE)
$(MODVENDOR_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing modvendor $(MODVENDOR_VERSION) ..."
rm -f $(MODVENDOR)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/goware/modvendor@$(MODVENDOR_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/goware/modvendor@$(MODVENDOR_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -119,7 +119,7 @@ $(MODVENDOR): $(MODVENDOR_VERSION_FILE)
$(GIT_CHGLOG_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing git-chglog $(GIT_CHGLOG_VERSION) ..."
rm -f $(GIT_CHGLOG)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) go install github.com/git-chglog/git-chglog/cmd/git-chglog@$(GIT_CHGLOG_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) go install github.com/git-chglog/git-chglog/cmd/git-chglog@$(GIT_CHGLOG_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -128,7 +128,7 @@ $(GIT_CHGLOG): $(GIT_CHGLOG_VERSION_FILE)
$(MOCKERY_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing mockery $(MOCKERY_VERSION) ..."
rm -f $(MOCKERY)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) go install -ldflags '-s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=$(MOCKERY_VERSION)' github.com/vektra/mockery/v2@v$(MOCKERY_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) go install -ldflags '-s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=$(MOCKERY_VERSION)' github.com/vektra/mockery/v2@v$(MOCKERY_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand All @@ -137,7 +137,7 @@ $(MOCKERY): $(MOCKERY_VERSION_FILE)
$(GOLANGCI_LINT_VERSION_FILE): $(AP_DEVCACHE)
@echo "installing golangci-lint $(GOLANGCI_LINT_VERSION) ..."
rm -f $(MOCKERY)
(cd $(GO_PKG); GOBIN=$(AKASH_DEVCACHE_BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))
(cd $(GO_ROOT); GOBIN=$(AKASH_DEVCACHE_BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand Down
39 changes: 18 additions & 21 deletions make/test.mk
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
TEST_GO_MODULES ?= ./...
GO_MODULES ?= $(shell find * -name go.mod -exec dirname {} \;)
GO_TEST_DIRS ?= ./...
GO_COVER_PACKAGES = $(shell cd $(GO_ROOT); go list $(GO_TEST_DIRS) | grep -v mock | paste -sd, -)

SUB_TESTS ?= go \
ts
GO_CURR_MODULE = $(shell go list -m 2>/dev/null)

COVER_GO_PACKAGES = $(shell cd $(GO_PKG); go list ./... | grep -v mock | paste -sd, -)
SUB_TESTS ?= go \
ts

TEST_GO_OPTS ?=
TEST_GO_TIMEOUT ?= 300
GO_TEST_OPTS ?=
GO_TEST_TIMEOUT ?= 300

test_go_flags := -timeout $(TEST_GO_TIMEOUT)s
test_go_flags := -timeout $(GO_TEST_TIMEOUT)s

ifneq (,$(findstring nocache,$(TEST_GO_OPTS)))
ifneq (,$(findstring nocache,$(GO_TEST_OPTS)))
test_go_flags += -count=1
endif

ifneq (,$(findstring race,$(TEST_GO_OPTS)))
ifneq (,$(findstring race,$(GO_TEST_OPTS)))
test_go_flags += -race
endif

ifneq (,$(findstring verbose,$(TEST_GO_OPTS)))
ifneq (,$(findstring verbose,$(GO_TEST_OPTS)))
test_go_flags += -v
endif

Expand All @@ -30,23 +32,18 @@ test-coverage: $(patsubst %, test-coverage-%,$(SUB_TESTS))

.PHONY: test-ts
test-ts: $(AKASH_TS_NODE_MODULES)
cd ts && npm run test
cd $(TS_ROOT) && npm run test

.PHONY: test-coverage-ts
test-coverage-ts: $(AKASH_TS_NODE_MODULES)
cd ts && npm run test:cov
cd $(TS_ROOT) && npm run test:cov

.PHONY: test-go
test-go: export GO111MODULE := $(GO111MODULE)
test-go:
cd $(GO_PKG) && $(GO) test $(test_go_flags) $(TEST_GO_MODULES)
@$(TOOLS) gotest "$(GO_MODULES)" "$(test_go_flags)" "$(GO_TEST_DIRS)"

.PHONY: test-coverage-go
test-coverage-go: export GO111MODULE := $(GO111MODULE)
test-coverage-go:
cd $(GO_PKG) && $(GO) test -coverprofile=coverage.txt \
-covermode=count \
-coverpkg="$(COVER_GO_PACKAGES)" \
$(TEST_GO_MODULES)

.PHONY: test-go-vet
test-go-vet:
cd $(GO_PKG) && $(GO) vet $(TEST_GO_MODULES)
@$(TOOLS) gocoverage "$(GO_MODULES)" "$(test_go_flags)" "$(GO_TEST_DIRS)"
1 change: 1 addition & 0 deletions script/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function gen_go() {
gen buf.gen.go.yaml

set -x
# shellcheck disable=SC2086
cp -r ./$1/* ./$2/
}

Expand Down
2 changes: 1 addition & 1 deletion script/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

unset FAILED

FILES=$(find /shellcheck/ -type f -name "*.sh" ! -path "/shellcheck/vendor/*" ! -path "/shellcheck/.git/*" ! -path "/shellcheck/ts/.husky/*" ! -path "/shellcheck/ts/node_modules/*")
FILES=$(find /shellcheck/ -type f -name "*.sh" ! -path "/shellcheck/go/vendor/*" ! -path "/shellcheck/.git/*" ! -path "/shellcheck/ts/.husky/*" ! -path "/shellcheck/ts/node_modules/*")

for file in $FILES; do
name="$(basename "$file")";
Expand Down
77 changes: 74 additions & 3 deletions script/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set -eo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
SEMVER=$SCRIPT_DIR/semver.sh

GO_PKG=$(realpath "$SCRIPT_DIR/../go")
GO_ROOT=$(realpath "$SCRIPT_DIR/../go")

gomod="$GO_PKG/go.mod"
gomod="$GO_ROOT/go.mod"

function get_gotoolchain() {
local gotoolchain
Expand Down Expand Up @@ -69,7 +69,7 @@ function replace_import_path() {

curr_module_name=$(cd go; go list -m)
curr_version=$(echo "$curr_module_name" | sed -n 's/.*v\([0-9]*\).*/\1/p')
new_module_name=${curr_module_name%/v$curr_version}/$next_major_version
new_module_name=${curr_module_name%/"v$curr_version"}/$next_major_version

echo "current import paths are $curr_module_name, replacing with $new_module_name"

Expand Down Expand Up @@ -121,6 +121,69 @@ function replace_import_path() {
replace_paths "./go/go.mod" "$curr_module_name" "$new_module_name"
}

function run_gotest() {
declare -a modules

modules=( "$1" )

if [ -z "$AKASH_ROOT" ]; then
echo "AKASH_ROOT environment variable is not set"
exit 1
fi

if [ -z "$GO111MODULE" ]; then
echo "GO111MODULE environment variable is not set"
exit 1
fi

# shellcheck disable=SC2068
for module in ${modules[@]}; do
pushd "$(pwd)"
cd "$module"
# shellcheck disable=SC2086
go test ${2} ${3}
popd
done
}

function run_gocoverage() {
declare -a modules


modules=( "$1" )

if [ -z "$AKASH_ROOT" ]; then
echo "AKASH_ROOT environment variable is not set"
exit 1
fi

if [ -z "$GO111MODULE" ]; then
echo "GO111MODULE environment variable is not set"
exit 1
fi

# shellcheck disable=SC2068
for module in ${modules[@]}; do
pushd "$(pwd)"
cd "$module"
local coverpkgs

# shellcheck disable=SC2086
coverpkgs=$(go list ${3} | grep -v mock | paste -sd, -)

local coverprofile
coverprofile="$AKASH_ROOT/coverage-$(echo "$module" | tr '/' '-').txt"

# shellcheck disable=SC2086
go test ${2} -coverprofile="$coverprofile" \
-covermode=count \
-coverpkg="$coverpkgs" \
${3}

popd
done
}

case "$1" in
gotoolchain)
get_gotoolchain
Expand All @@ -129,4 +192,12 @@ replace-import-path)
shift
replace_import_path "$@"
;;
gotest)
shift
run_gotest "$@"
;;
gocoverage)
shift
run_gocoverage "$@"
;;
esac

0 comments on commit fd6d7d0

Please sign in to comment.