#28 Allow override of %gomodulesmode
Closed 3 years ago by jwendell. Opened 3 years ago by jwendell.

Currently it is hardcoded in macros.go-compilers-golang line 35:

Turn off Go modules

%gomodulesmode GO111MODULE=off

This is preventing me to build passing the flag "=mod=vendor". I'm currently setting:
%global gocompilerflags "-mod=vendor"
in my .spec.

Build fails with:
build flag -mod=vendor only valid when using modules

Because %gomodulesmode is being passed to go build.

Ideally we should be able to override it, so that it works when trying to use -mod=XXX value.


Have you tried redefining gomodulesmode in your SPEC:

%global gomodulesmode GO111MODULE=on

No, I didn't know it would work. Thanks.

Metadata Update from @jwendell:
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata