在gitlab的ci里面配置了golangci-lint检查,但是偶尔总出现level=error msg="Timeout exceeded: try increasing it by passing --timeout option"
这种错误, 重新执行一次就正常了,虽然几率小,但还是会造成困扰,于是找了下问题,分享下解决方案。
错误
![golangci-lint timeout](https://img-blog.csdnimg.cn/20210125101918179.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2lvcmlkeQ==,size_16,color_FFFFFF,t_70)
解决方法
在golangci-lint运行时,加上timeout的参数设置(默认是1分钟)
golangci-lint run ./... --timeout=10m
详细的信息可以通过命令行的help查看:golangci-lint run -h
![golangci-lint run help](https://img-blog.csdnimg.cn/2021012510194370.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2lvcmlkeQ==,size_16,color_FFFFFF,t_70)