#!/bin/sh
# Builds and runs a small program against the installed desync -dev package to
# confirm the library can be imported and used.
# dh-golang installs the library source under /usr/share/gocode so build in
# GOPATH mode.
set -eu

export GOPATH=/usr/share/gocode
export GO111MODULE=off
export GOFLAGS=-mod=mod
export GOCACHE="$(mktemp -d)"
trap 'rm -rf "$GOCACHE"' EXIT

go run debian/tests/library-test.go
echo "desync library-test: OK"
