add IsLocalhost utility function + go fmt