-2

I need to use go 1.17.9.

mod file

However I need to use a different ( lower ) version of "golang.org/x/net" package, not the one specified in mod file.

  • How would I go about it i.e. are there commands to edit go.mod and re-fetch the desired versions ?
  • Also why do I not see the version of ""golang.org/x/net" specified in 1.17.9's mod file in here -> https://pkg.go.dev/golang.org/x/net?tab=versions, am I looking at the wrong place ?

EDIT - I do not need it in my modules directly. My code is calling net, which calls x/net vendored into std library and relies on the older version of x/net to work. Specifically here is the change that broke. My code used to passes a "wss" request and the code would return "non-nil" now with this change it returns "nil" sine it only identifies "http" and "https" scheme. https://cs.opensource.google/go/x/net/+/7b1cca2348c07eb09fef635269c8e01611260f9f

JavaDeveloper
  • 5,320
  • 16
  • 79
  • 132
  • 2
    The version vendored into the std library does not effect what you can use in your modules (short of it being completely incompatible with the go version). Why do you believe you need an older version of the `golang.org/x/net` package, and what problem did you have using it? – JimB May 17 '22 at 18:27
  • If you are trying to modify the Go std library itself, then you should be able to update the go.mod and vendor files in the standard library. There's no separate tooling for this from within your module, you are essentially trying to patch the code within the std library. – JimB May 17 '22 at 19:21

1 Answers1

-1

i think you just change what do you want, if you wanna add you just use go mod vendor (for adding new vendor) and go mod tidy (for update on your package)