common function in go