First of all: Amazing effort to write an independent Bitcoin implementation as an (as it seems) single contributor.
I stumbled upon this thanks to this Tweet, which points to the same author's blog article comparing different Bitcoin node implementations' performance.
I wanted to take a dive into the code, but realized that in many/most packages, for example github.com/piotrnar/gocoin/lib/btc, most exported types and functions don't have any Godoc comment. Some types/functions have comments, but don't adhere to the Godoc format (like beginning with the name of the type/function, as mentioned in this Go Blog article).
See the Godoc of that package here: https://godoc.org/github.com/piotrnar/gocoin/lib/btc
Examples of well documented packages:
Proper Godoc comments might be helpful for
- potential contributors who want to dive into and understand the code and
- package users who want to use your exported packages as a library for their own applications.
To not export some packages at all you could use an internal directory, as explained in the Go 1.4 release notes.
As a side note, the recently announced official https://go.dev website, which offers an updated / extended version of Godoc, for example to support versioned Go modules, seems to not be able to understand your LICENSE and thus thinks it's not allowed to show your Godoc at all. See https://pkg.go.dev/github.com/piotrnar/gocoin/lib/btc?tab=doc.
“Doc” hidden due to license restrictions.
First of all: Amazing effort to write an independent Bitcoin implementation as an (as it seems) single contributor.
I stumbled upon this thanks to this Tweet, which points to the same author's blog article comparing different Bitcoin node implementations' performance.
I wanted to take a dive into the code, but realized that in many/most packages, for example
github.com/piotrnar/gocoin/lib/btc, most exported types and functions don't have any Godoc comment. Some types/functions have comments, but don't adhere to the Godoc format (like beginning with the name of the type/function, as mentioned in this Go Blog article).See the Godoc of that package here: https://godoc.org/github.com/piotrnar/gocoin/lib/btc
Examples of well documented packages:
Proper Godoc comments might be helpful for
To not export some packages at all you could use an
internaldirectory, as explained in the Go 1.4 release notes.As a side note, the recently announced official https://go.dev website, which offers an updated / extended version of Godoc, for example to support versioned Go modules, seems to not be able to understand your LICENSE and thus thinks it's not allowed to show your Godoc at all. See https://pkg.go.dev/github.com/piotrnar/gocoin/lib/btc?tab=doc.