Please answer these questions before submitting your issue. Thanks!
go version)?Go 1.11
yes
go mod init
go mod tidy
Into go.mod, is it possible to have (like into comment into source code) align of // indirect
module myModule
require (
github.com/something v1.0.0
github.com/foo v1.0.0 // indirect
github.com/foo/bar v1.0.0 // indirect
)
module myModule
require (
github.com/something v1.0.0
github.com/foo v1.0.0 // indirect
github.com/foo/bar v1.0.0 // indirect
)
/cc @bcmills @rsc to see if we actually want to do this.
Personally, I'm not a big fan of alignment like that. it messes up diffs - what would be a single-line addition or removal of a dependency becomes a change to every line with a // indirect comment on.
Also, hopefully, we'll see many less // indirect comments as time goes on and more and more repositories get go.mod files, so this will become less of an issue over time.
Also, hopefully, we'll see many less // indirect comments as time goes on and more and more repositories get go.mod files, so this will become less of an issue over time.
It is appear to be acceptable.
Thx
As @rogpeppe notes, // indirect requirements should decrease over time.
(It's true that alignment add spurious diffs, but arguably diff -b — a.k.a. diff --ignore-space-change is a good default for Go development anyway, given gofmt.)
Most helpful comment
Personally, I'm not a big fan of alignment like that. it messes up diffs - what would be a single-line addition or removal of a dependency becomes a change to every line with a
// indirectcomment on.Also, hopefully, we'll see many less
// indirectcomments as time goes on and more and more repositories getgo.modfiles, so this will become less of an issue over time.