简体   繁体   中英

How to use a customize go mod while installing GO?

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 ie 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

我想你只是改变你想要的,如果你想添加你只需使用go mod vendor (用于添加新供应商)和go mod tidy (用于更新你的包)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM