本文介绍了禁用go vet检查“composite literal uses unkeyed fields”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 复合文字使用未加字段的字段

因为我正在实例化

pre > type A struct {
* B
}

像这样:

  A {b} // b是类型* B 

我不在乎这个警告,并且想要在我的兽医检查中禁用它。

解决方案


I'm running go vet on my CI tool, and started getting the error:

composite literal uses unkeyed fields

Because I'm instantiating

type A struct {
   *B
}

like this:

A{b} // b is of type *B

I don't care for this warning, and want to disable it on my go vet checks. How do I do this?

解决方案

这篇关于禁用go vet检查“composite literal uses unkeyed fields”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-04 00:08