Hi Tobias,

On Wed, Jun 24, 2026 at 3:22 PM Dr. Tobias Quathamer <[email protected]> wrote:
> no, I haven't. Interesting thought, though. However, I thought that it

I tested builds with following different conditions:
BUILD A (GO111MODULE=auto Mode with go.mod)
BUILD B (unset GO111MODULE Mode with go.mod)
BUILD C (GO111MODULE=auto Mode without go.mod)
BUILD D (GO111MODULE=off Mode without/ignore go.mod)

I found GO111MODULE=auto works with and without go.mod file.

You can test with the script here:
  https://salsa.debian.org/ajqlee/go-utils/-/blob/master/go111module-test.sh

> might be better to "inject" a minimal go.mod file for those cases, with
> just one line, "module a/b/c". From my understanding, this is what the
> golang compiler does in such cases.
>
> My goal would be to mimic the upstream compiler behavior as closely as
> possible in our builds.

The `GO111MODULE=auto` is directly from upstream go compiler to handle
such case. I think we better to use that instead of "inject" a go.mod
file that upstream doesn't provide.

Best regards,
-- 
-Andrew

Reply via email to