gowriter: [wip] refactor and pull out 'get_golang_type'.