Added the go function and tests