1#!/bin/bash 2 3DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 4 5lines=$(wc -l "${DIR}/header.txt" | cut -d' ' -f1) 6 7find . -name '*.go' | while read file; do 8 diff <(head -n $lines "${file}") "${DIR}/header.txt" >/dev/null || { 9 echo "${file} missing license" 10 exit 1 11 } 12done