-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: GO111MODULE=off is treated as as GODEBUG=default=go1.20 #71412
Comments
GO111MODULE=off
changes behaviour of ServeMux
currently the default godebugs come from the module, if a go directive isn't present, it assumes go1.20 (last version before godebug controls were introduced) |
thank you for the clarification but shouldn't this show up with
|
posting the status-quo in case others stumble over the same issue. additional information can be found in the docs:
|
@matloob @samthanawalla |
Go version
go version go1.23.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
i am running an application which uses a net/http.ServeMux with pattern features introduced with golang1.22
(e.g.
http.HandleFunc("/{$}" ...
to handle only requests forGET / HTTP/XXX
)building the application with
GO111MODULE=off
causes the application to respond with404 page not found
for requests which would otherwise be handled when running the application withGO111MODULE=on
.i have provided a simple reproducer
What did you see happen?
in another terminal
in another terminal
the request against the
/{$}
path is expected to yield a 404; i have included it for the sake of completeness%7B%24%7D
is the URL encoded notation of{$}
What did you expect to see?
i was expecting the golang1.22 net/http changes to be available regardless of the use of
GO111MODULE=off
. AFAIK this environment variable affects the code lookup and the compiler's expectations about the project layout and location. i did not expect it to downgrade/disable any language features.The text was updated successfully, but these errors were encountered: