buildGoModule with race detector

I’m building a go program using buildGoModule. I specify -race via buildFlags but it says

trace: warning: Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray

How should I enable the race detector using buildGoModule?

I think you want to set ldflags = [ "-race" ];

1 Like

Ah, thank you! (Sorry this is fully on me for not understanding…)