#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES := examples

%:
	dh $@ --buildsystem=golang --with=golang

override_dh_auto_test:
	# Testing drivers/store/redis requires a running redis server, let's skip it.
	# To find test targets dh-golang uses the same mechanism it uses to find build
	# targets, so we can use DH_GOLANG_EXCLUDES to skip tests.
	DH_GOLANG_EXCLUDES="$(DH_GOLANG_EXCLUDES) drivers/store/redis" dh_auto_test

override_dh_auto_install:
	dh_auto_install

	# Workaround for #904261:
	for pkg in $(DH_GOLANG_EXCLUDES); do \
	    rm -rfv debian/*/usr/share/gocode/src/github.com/ulule/limiter/$$pkg;\
	    done
