golang中关于range的坑 | lylex's humble Home
lylex opened this issue · comments
lylex commented
http://qianzhou.tech/2018/12/26/golang-trap-in-range/
golang中关于range的坑今天发现之前写的drm中出了一个bug,打印数据库中取出的东西不一样的数据后居然显示的内容一样的,很久以前遇到过类似的错误,现今又重犯了,故而决定把它记下来,希望大家都能引以为戒。 先看一个简化的代码片段: 1234567891011121314151617181920212223242526type Blob struct { ID str