我在CI工具上运行Go VET,并开始收到错误:
composite literal uses unkeyed fields
因为我正在实例化
type A struct {
*B
}
这样地:
A{b} // b is of type *B
我不在乎这个警告,我想在我的GO兽医判断中禁用它.我该怎么做呢?
我在CI工具上运行Go VET,并开始收到错误:
composite literal uses unkeyed fields
因为我正在实例化
type A struct {
*B
}
这样地:
A{b} // b is of type *B
我不在乎这个警告,我想在我的GO兽医判断中禁用它.我该怎么做呢?
$ go doc cmd/vet
默认情况下,将执行所有判断.如果明确设置了任何标志 设置为true,则仅运行这些测试.相反,如果任何标志是 显式设置为False,则仅禁用这些测试.因此, -printf=true运行printf判断,-printf=false运行除printf判断之外的所有判断.
Unkeyed composite literals Flag: -composites Composite struct literals that do not use the field-keyed syntax.