dotfiles/shell/source/go.sh

20 lines
455 B
Bash

unset GOROOT
path.append $HOME/.local/go/bin
which go &> /dev/null || return
path.append $HOME/go/bin
function go.test
{
func=${1:-.*}
if [[ $func == *'/'* ]]; then
suite=$(echo $func | cut -d/ -f1)
func=$(echo $func | cut -d/ -f2)
else
suite=".*"
fi
# syntax error bash
# go test -run ^${suite}$ -testify.m ^(${func})$ -v . | ccze -A
go test -run ^${suite}$ -testify.m ^\(${func}\)$ -v . | ccze -A
}