Disable go vet checks for “composite literal uses unkeyed fields”

后端 未结 5 1549
醉酒成梦
醉酒成梦 2021-02-04 01:13

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

composite literal uses unkeyed fields

Because I\'m instantiating



        
5条回答
  •  我在风中等你
    2021-02-04 01:16

    If you are using VS code, you have to manually set the flag under settings

    settings > Extensions > Go

    Scroll down to "Vet Flags" section

    Add Item and add the flag

    -composites=false .
    

    Click ok.

    Save one of your files again or restart VS code to see the effect.

提交回复
热议问题