#!/bin/sh # script/fmt-check: check formatting (read-only). Same scope as # script/fmt, but fails instead of writing. --no-cache because a cached # check is a check that did not run. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" main() { cd "$ROOT" if [ -n "$(gofmt -s -l .)" ]; then echo "gofmt needed on:" gofmt -s -l . exit 1 fi docker build --no-cache --target markdown-check --output type=cacheonly . } main "$@"