#!/bin/bash set -e # fail on any error PKG=$(cat go.mod | grep module | awk '{print $2}') PKG_LIST=$(go list ${PKG}/... ) for CUR_PKG in $PKG_LIST do go test -timeout 30s -coverprofile=/tmp/go-code-cover $CUR_PKG done