duankang8114 2016-03-29 01:33
浏览 83
已采纳

禁用兽医检查“复合文字使用无键字段”

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?

  • 写回答

4条回答 默认 最新

  • dtnpzghys01643322 2016-03-29 01:44
    关注
    $ go doc cmd/vet
    

    By default all checks are performed. If any flags are explicitly set to true, only those tests are run. Conversely, if any flag is explicitly set to false, only those tests are disabled. Thus -printf=true runs the printf check, -printf=false runs all checks except the printf check.

    Unkeyed composite literals
    
    Flag: -composites
    
    Composite struct literals that do not use the field-keyed syntax.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥15 对于这个问题的解释说明
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败