added code and test to Go