Skip to content

Add Godoc comments #53

Description

@philippgille

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

  1. potential contributors who want to dive into and understand the code and
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions