我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

执行os.Exit(1)时如何禁用“退出状态1”

In one of my go projects, I run os.Exit(1) and it prints out exit status 1. How can I disable this message to be printed?

To disable the message, don't use go run.

go run is a tool to conveniently compile one or more go files into a temporary location, execute the binary, and clean up. Your executable is run in a sub-process, and the go tool is reporting the exit status for you.

近期文章

  • 如何从函数调用中获取返回值的指针?
  • 实例新类型(Golang)
  • 我可以使用MarshalJSON向golang中的json编码添加任意字段吗?
  • 转到测试标志:提供了标志但未定义
  • WaitGroup.Wait()的超时
  • 编译工作正常,但运行失败
  • 如何在Scala中返回函数
  • 如何在golang中将文本追加到文件中? [重复]
  • 流大JSON
  • 如何使用“内部”包?
  • 如何在Golang中写入文件
  • 从Go中的标准输入中读取字符(无需按Enter)
  • 进行每个测试的测试设置和拆卸
  • 无法猜测模仿类型
  • 使用正常功能在Golang中返回类似“ ok”的地图
  • 从Go Appengine网站发送Apple推送通知
  • 如何在Go中删除struct对象?
  • 如何将Go程序从Mac OS X交叉编译到Ubuntu 64位
  • websocket-建立连接错误:net :: ERR_INSECURE_RESPONSE
  • 混淆上下标题

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华