GoLand defer 提示 Unhandled error 解决方法
Go GoLand About 218 words代码处理
defer func() {
err := db.Close()
if err != nil {
fmt.Println(err)
return
}
}()
也可以不关心错误
defer func() {
_ = db.Close()
}()
编辑器处理
在设置中Editor
下的Inspections
搜索框中搜索Unhandler error
,取消勾选即可。
Views: 9,839 · Posted: 2020-10-24
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓

Today On History
- Telepresence 开发中的常用命令 Views: 1,375 · Posted: 2023-04-08
- Java 中的锁 ReentrantReadWriteLock 读写锁 Views: 2,034 · Posted: 2021-04-08
- Spring Boot 打包本地 jar 包到 war 包中 Views: 2,247 · Posted: 2020-04-08
- Android adb 命令 Views: 5,775 · Posted: 2019-04-08
- JavaScript 页面切换后更改标题 Views: 2,115 · Posted: 2019-04-08
- IDEA 滚轮调节字体大小 Views: 3,560 · Posted: 2019-04-08
- IDEA 去除 Unchecked cast from Object to 提示 Views: 4,690 · Posted: 2019-04-08
- Java 按字典顺序排序请求参数 Views: 6,330 · Posted: 2019-04-08
- Java 储存相同 key 的 map Views: 4,128 · Posted: 2019-04-08
- Java 测试迭代集合耗时 Views: 3,963 · Posted: 2019-04-08
- The temporary upload location [xxxRoot] is not valid Views: 3,522 · Posted: 2019-04-08
- Spring Boot Undertow 上传文件后没有可读权限 Views: 6,692 · Posted: 2019-04-08
- Java8 @FunctionalInterface 注解 Views: 2,328 · Posted: 2019-04-08
- Vue-cli+webpack 配置接口代理解决跨域问题 Views: 3,327 · Posted: 2019-04-08
- PHP 序列化与反序列化 Views: 2,854 · Posted: 2019-04-08
- PHP 关闭 X-Powered-By 信息 Views: 2,231 · Posted: 2019-04-08
- PHP编译安装redis扩展 Views: 2,829 · Posted: 2019-04-08
- PHP Markdown 解析器 Views: 3,330 · Posted: 2019-04-08
- PHP查看配置文件所在位置 Views: 2,410 · Posted: 2019-04-08
- PHP 压缩 HTML 代码 Views: 2,633 · Posted: 2019-04-08
- PhpStorm 设置大括号不换行 Views: 8,945 · Posted: 2019-04-08
- PHP 时间加减 Views: 3,167 · Posted: 2019-04-08
- PHP curl 报错:SSL connect error Views: 3,866 · Posted: 2019-04-08
- PHP 字段对应 MySQL 字段 Views: 2,601 · Posted: 2019-04-08
- ThinkPHP5 设置 Redis 长连接 Views: 5,848 · Posted: 2019-04-08
- ThinkPHP5 设置数据库长连接 Views: 5,792 · Posted: 2019-04-08
- PHP 生成重复固定随机数邀请码 Views: 3,525 · Posted: 2019-04-08
- PHP 使用 json_encode 格式化下标不为 0 开始的数组会转为对象 Views: 3,730 · Posted: 2019-04-08
- PHP 获取毫秒值时间戳 Views: 4,542 · Posted: 2019-04-08
- PHP 设置 json_encode 不转义中文 Views: 3,100 · Posted: 2019-04-08
- PHP 判断函数、类、方法、属性、数组中的 key 是否存在 Views: 5,407 · Posted: 2019-04-08
- Redis 提示没有权限 Views: 4,860 · Posted: 2019-04-08
- Redis 线上禁用命令 Views: 3,449 · Posted: 2019-04-08
- Redis 最大内存策略 Views: 2,262 · Posted: 2019-04-08
- Redis 内存信息 Views: 3,084 · Posted: 2019-04-08
- Redis 使用 bigkeys 命令查找大 key Views: 5,791 · Posted: 2019-04-08
- Redis 运行统计信息 Views: 2,754 · Posted: 2019-04-08
- Redis 实现统计在线人数、每日签到功能 Views: 6,266 · Posted: 2019-04-08
- Redis 使用 HyperLogLog 统计独立 IP 数 Views: 3,762 · Posted: 2019-04-08
- Redis 监控 monitor Views: 3,237 · Posted: 2019-04-08
- Redis 过期时间问题 Views: 2,936 · Posted: 2019-04-08
- Redis 查看连接数 Views: 3,743 · Posted: 2019-04-08
Browsing
Refresh
Loading...
- Spring Boot 代码中生成 MultipartFile 对象 Views: 2135
- PHP 字段对应 MySQL 字段 Views: 2601
- Arthas 使用 trace 查找耗时操作和调用链路 Views: 11711
- Kubernetes 查看容器进程使用内存情况 Views: 1926
- IDEA 使用 Swing Explorer 调试 Swing 和 AWT Views: 4250
- JavaScript 删除数组中指定元素 Views: 1329
- Android 不允许用户清理数据 Views: 2927
- JavaScript 异步任务中的宏任务和微任务 Views: 1634
- 自定义 Spring Boot Starter 中的组件无法被 Spring 扫描注册 Views: 2796
- IDEA Debug Stream 流 Views: 2331