We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可以通过os.Getwd完成 但是当我们需要处理错误时,将这个从主逻辑中分离出来会更好。函数log.Fatalf用于打印日志信息然后调用os.Exit()来终止程序。
var cwd string func init(){ var err error cwd, err = os.Getwd() if err != nil{ log.Fatalf("os.Getwd failed: %v", err) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
可以通过os.Getwd完成
但是当我们需要处理错误时,将这个从主逻辑中分离出来会更好。函数log.Fatalf用于打印日志信息然后调用os.Exit()来终止程序。
The text was updated successfully, but these errors were encountered: