错误排查
已收录文章:2篇
-
Golang · Go问答 | 5天前 | go · 性能 · bufio · 日志处理 · 错误排查 · 分块读取 Go bufio.Scanner token too long Scanner.Buffer 大日志行Go 用 bufio.Scanner 逐行读取日志时,遇到超长 JSON 行会返回 token too long。本文用可复现实验比较默认上限、Scanner.Buffer 和 bufio.Reader 分块读取的内存与吞吐边界,给出线上日志处理的选择方法。501 收藏
-
Golang · Go教程 | 1天前 | 标准库 · go · html/template · 错误排查 · Web模板 · Parse 模板函数 Go html/template FuncMap 模板初始化Go html/template 使用自定义函数时,FuncMap 必须在 Parse 或 ParseFiles 前注册,否则模板会在解析阶段报 function 未定义。本文用一个邮件通知模板的小实验,拆开注册顺序、模板错误定位、运行时参数校验和安全边界。451 收藏