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

如何在Golang中测试日志记录(log.Println)?

How to test below the code in Golang?

package main

import "log"

func main() {
    log.Println("hello world")
}

Your program writes to the log package standard logger which writes to standard error. Compile and run your program and see what appears on standard error.

近期文章

  • Go Web应用程序中的CSRF
  • 在托管虚拟机的本地开发环境中运行Web应用程序时出现appengine.NewContext错误
  • 使用unmarshal从响应中获取特定的JSON字段
  • 尝试安装BEEGO时出错
  • CGO:如何在Golang中使用指针从C中的数组访问数据
  • 我可以运行带有HTML / JavaScript UI的Go Web服务器作为跨平台应用程序(Linux,Android,iOS,macOS,Windows)
  • 出错-单值上下文中的多值fn()
  • Geth Ecrecover无效的签名恢复ID
  • 在golang中使用全局mongo(mgo)数据库有何弊端? [关闭]
  • 获取字符串数组中每个字符串的第一个字符
  • 从JSON提取元素
  • 如何在Golang的RESTful API中维护应用程序状态
  • net / http:是否可以具有http.HandleFunc自定义参数?
  • Go中的结构图与结构数组
  • 无法安装Go软件包
  • 我是否需要从该功能中释放或释放地图?
  • 垃圾收集器如何找到有关从堆栈完成的对象引用的信息?
  • 如何在Go中获取所有请求标头
  • 在Go中调用os.Open(<filename>)时如何检查错误?
  • 同时附加/插入Elasticsearch

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华