goc icon indicating copy to clipboard operation
goc copied to clipboard

Fail to build if main.go declare log

Open jueerwl opened this issue 3 years ago • 2 comments

./http_cover_apis_auto_generated.go:11:2: log redeclared in this block previous declaration at ./main.go:8

jueerwl avatar Apr 21 '21 07:04 jueerwl

The log library goc used comes from golang official package: https://golang.org/pkg/log/, while seems you redeclared it in your main.go:8

can use please share with us why you redeclared it? @jueerwl

CarlJi avatar Apr 21 '21 07:04 CarlJi

开发人员需要打log来输出程序信息,log这个变量也是打日志非常通用的变量名,所以被重复定义的可能性很高哈。在每一个方法都需要同样的log时,说服开发每个方法定义一次,比较困难

jueerwl avatar Apr 21 '21 09:04 jueerwl

fixed by #305

CarlJi avatar Sep 05 '22 09:09 CarlJi