I am using an open source project called "yaegi" in a large project.
I need to use older version of "yaegi": v.0.8.11
, so I modified the go.mod
file and replaced:
github.com/traefik/yaegi v0.9.2 // indirect
with github.com/containous/yaegi v0.8.11
But when I build the project, it starts to update all the modules and replace it back to the most updated version:
root@ubuntu:~/myproj1# go build main.go
go: finding module for package github.com/traefik/yaegi/stdlib/unsafe
go: finding module for package github.com/traefik/yaegi/stdlib
go: finding module for package github.com/traefik/yaegi/interp
go: found github.com/traefik/yaegi/interp in github.com/traefik/yaegi v0.9.2
How can I prevent it and keep it using the old version v.0.8.11
?
I read that according to https://tip.golang.org/cmd/go/#hdr-Maintaining_module_requirements:
The
go
command itself automatically updates thego.mod
file to maintain a standard formatting and the accuracy ofrequire
statements.Any go command that finds an unfamiliar import will look up the module containing that import and add the latest version of that module to go.mod automatically. […]
Any go command can determine that a module requirement is missing and must be added […].
Maybe there is a way to bypass it?