You can get the same behaviour with sed without "programmability":
$ sed -n '/^func Test/,/^}/p' file
Which means: match 'func Test' at the beginning of a line and print (p command at the end) until you find a line beginnning with '}'.This is because the print command (p) accepts 2 addresses to delimit a range. I used regexes as addresses but, for instance, can use line numbers also:
$ sed -n '10,20p' file
This prints file's line from 10 to 20.By default, sed prints the pattern space (modifications to each line) at the end of the script. The -n I used is to avoid that.