I recently hit a little issue with go.mod versioning that's confusing me.
My go.mod is straightforward:
https://github.com/deepmap/oapi-codegen/blob/master/go.mod

One of the packages in there is kin-openapi at v0.47.0:
github.com/getkin/kin-openapi v0.47.0

We briefly had some code in the repo which referred to some files which
weren't present in kin-openapi@v0.47.0, but these files were present in
kin-openapi@0.52.0
https://github.com/deepmap/oapi-codegen/pull/322

I would have expected that files not being present in 0.47.0 would result
in a compiler error, but instead, what happened is that my go.mod had its
kin-openapi requirement increased to 0.52.0 automatically by go build.

It's surprising to me that Go is smart enough to figure out that a
subsequent version of that module contains what I'm looking for, and it
updates go.mod. In my case, this isn't the behavior that I wanted. So, is
there a way disable this automated roll-up? I want my code to break if I
refer to something in a newer package.

Thanks,
-- Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LvpzRMOPyEeRzzekwv%3D4EaORuU%2BSp78sW-mm_DmUHyjZQ%40mail.gmail.com.

Reply via email to