summaryrefslogtreecommitdiff
path: root/src/nslcd_proto/util/struct_null_backend.go.sh
blob: 7cbdbd08d7c5c4934180fcdccee73556f863ff74 (plain)
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