Go mod tidy 1.17 duplicates require()

Hi,

I’ve notice that on one of my projects that has a go.mod with:

go 1.16

if I change it to 1.17 and run go mod tidy it duplicates the entire require() block? Is this something new in 1.17? A bug?

tried on a simple project and the same is happening… I’m I safe to assume this is normal?

module github.com/narven/example-go-mod

go 1.17

require github.com/valyala/fasthttp v1.30.0

require (
	github.com/andybalholm/brotli v1.0.2 // indirect
	github.com/klauspost/compress v1.13.4 // indirect
	github.com/valyala/bytebufferpool v1.0.0 // indirect
)

module github.com/narven/example-go-mod

go 1.16

require github.com/valyala/fasthttp v1.30.0

This a new feature, Go 1.17 is released - The Go Blog

2 Likes

There are two sections to separate direct and indirect dependencies.
Its a new feature

1 Like

I have also same issue any suggestion for this so please reply. Thanks in advance.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.