fix(go func factory): fix func factory example

previous code did not run because outside main() code was done