Added tailrec annotation to local go function