mirror of https://github.com/rwxrob/dot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
370 B
Plaintext
22 lines
370 B
Plaintext
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
_trim() {
|
||
|
local it="${1#"${1%%[![:space:]]*}"}"
|
||
|
it="${it%%//*}"
|
||
|
echo -e "${it%"${it##*[![:space:]]}"}"
|
||
|
}
|
||
|
|
||
|
|
||
|
interface="$1"
|
||
|
receiver="$2"
|
||
|
|
||
|
while IFS= read -r sig; do
|
||
|
sig=$(_trim "$sig")
|
||
|
name=${sig%%(*}
|
||
|
echo "//$name implements $interface interface."
|
||
|
# TODO get fancy with return type detection
|
||
|
echo "func (s $receiver) $sig {}"
|
||
|
done
|
||
|
|
||
|
|