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

在atEOF时,bufio.SplitFunc应该如何处理空数据

I am implementing my own custom bufio.SplitFunc and I'm getting

panic: bufio.Scan: too many empty tokens without progressing [recovered]
    panic: bufio.Scan: too many empty tokens without progressing

when running my code. I've debugged the issue down to my SplitFunc being called with empty data and atEOF=true. If I have no more tokens to return, what should my SplitFunc return? An error to stop the processing?

近期文章

  • 使用Kubernetes-client / go会给出Azure编译器错误
  • 为什么在多goroutine中读写切片会花费很多呢?
  • 由于切换到新的go mongo驱动程序,因此无法正确解析map [string] interface {}
  • go-gorm连接池不起作用,它创建了许多time_wait连接
  • 找不到软件包“ gdk-2.0”
  • Golang去测试专用目录
  • tyk无法在Windows上构建
  • 如何使用Golang连接ESX服务器
  • 带有密码的Golang UDP远程Shell
  • 调试时卡入stdin(fmt.Scan)的Go程序
  • 从环境文件golang中读取apm环境变量
  • xgo交叉编译不适用于alsa-lib
  • 调试自己的OVS控制器时出现问题(超时问题)
  • 如何使用Ginkgo和Gomega匹配私有结构类型?
  • 来自GoLang中GetDocumentAnalysis的AWS Textract键值对
  • Golang中rsa.EncryptOAEP()的C ++对应解码功能
  • 在asp.net中如何使用fileupload上传视频文件?
  • 使用$ in在mongo中向上插入多个文档而不循环
  • 通过ObjectId时间戳查询最近10分钟的所有文档
  • 使用Go测试HTTP / 2

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华