change threadfunc into macro, add singleton.go and singleton_test.go