1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/env bash # -*- Mode: Go -*- interface=$1 cat <<EOF package util import p "nslcd_proto" type NullBackend struct{} $(< "$interface" sed -rn 's/^\t([^(]+)\(Ucred, ([^)]+)\) (\S+)_Enumerator$/func (o NullBackend) \1(p.Ucred, p.\2) p.\3_Enumerator { return \3_Ø{} }/p') var _ p.Backend = NullBackend{} EOF