Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable go vet checks for "composite literal uses unkeyed fields"

Tags:

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?

like image 289
Matt Joiner Avatar asked Mar 29 '16 01:03

Matt Joiner


1 Answers

You can disable it or you can fix the code instead:

a := A{B: b} 

playground

like image 176
OneOfOne Avatar answered Sep 25 '22 14:09

OneOfOne