You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start a new project go mod init foo, then go get github.com/btcsuite/btcd, then add a main.go
package main
import (
_ "github.com/btcsuite/btcd"
)
func main() {
}
```
then
`go mod tidy`.
The resulting `go.sum` has tons of duplicate deps at different versions, for example
```
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
(All things aside) what was the thing you were trying to do? Maybe I could help out there. btcd's main package isn't really meant for outside usage, each of the individual packages are.
(All things aside) what was the thing you were trying to do? Maybe I could help out there.
We are using it in a few projects and I noticed that I could not get rid of the many duplicated deps and wondered why.
btcd's main package isn't really meant for outside usage, each of the individual packages are.
Why not? It's a perfectly usable library. I make use of the wire package a lot to parse Bitcoin transactions, or use the txscript package for various things. These are not nested modules either - what is the benefit of having btcutil being a nested module?
Nested modules are kind of confusing and seem hard to maintain anyway, seems more natural to just make it a package - would there be a downside to that?
Why not? It's a perfectly usable library. I make use of the wire package a lot to parse Bitcoin transactions, or use the txscript package for various things. These are not nested modules either - what is the benefit of having btcutil being a nested module?
Not much besides that it's just been like that.
Nested modules are kind of confusing and seem hard to maintain anyway, seems more natural to just make it a package - would there be a downside to that?
Start a new project
go mod init foo
, thengo get github.com/btcsuite/btcd
, then add amain.go
The reason is that for example,
[email protected]
references[email protected]
:btcd/go.mod
Line 5 in d55c55a
while btcutil in turn references
[email protected]
https://github.com/btcsuite/btcd/blob/d55c55a81f8f9cf2b0fa3cbb83e820ea28173081/btcutil/go.mod#L7C1-L7C64
which in turn references an older btcutil, and so on.
Not sure if there are more such instances.
I am unsure why btcutil is a module of its own, can't it just be a package inside btcd and not a module?
If it has to be a module, btcutil and btcd should ideally not depend on each other.
Barring all of that, the two should point to the same versions.
The text was updated successfully, but these errors were encountered: