helper functions for golang