DEV Community

Jonas Brømsø
Jonas Brømsø

Posted on

The Accidental Go Package Repository Contributor

I recently found out I had stuff on https://pkg.go.dev/, the Go package repository.

Apparently the repository is updated automatically from: https://proxy.golang.org/, which indexes and adds Go packages it finds - and yes commands/tools/utilities are packages in Go.

So imagine my surprise, when my vanity search yielded results:

  • punyencode
  • punydecode
  • testdemo

I love contributing to open source and I do much of my work in the open, meaning most of what I do is on GitHub. I have several Perl distributions on CPAN and I believe this was what surprised me. CPAN/PAUSE, like Rubygems, NPM, NuGET, Crates etc. all require explicit action in order to have your work included - with Go this is different - apparently.

So I do not mind my stuff being available on https://pkg.go.dev/, but these projects where never intended for publication, yes they are available publicly, but I have not put in any effort to make them comply with Go package guidelines.

Now that they are out there might as well present them. Lets start from the back of the list

testdemo (or go-test-demo) is a basic repository, which can be used to test or demo gotest (or go test for that matter). I wrote up a blog post about the colourful tool gotest, which is an implementation mimicking the regular go test command, which add colours, this was my contribution to demonstrate the use.

punyencode and it's cousin punydecode were both experiments to learn writing Go command line tools and implementing basic testing. Both are available on GitHub and are currently archived, since they have been deprecated for punycode, a tool which can handle both encoding and decoding punycode, since parsing a string can tell if it already punycode or not.

So these packages listed on https://pkg.go.dev/, but as you can see they do not bring much value, if any, to the Go ecosystem etc. apart from increasing the number of available packages.

Retracting a module from https://pkg.go.dev/ is possible according to the documentation, but the process seem pretty complex, so my recommendation it to perhaps make you repositories private, until you are ready for public scrutiny.

You can also explicitly request to have a package added, which seems like a more natural approach since it resembles the publication process of the other package repositories out there. And perhaps I should to this for punycode, which is the replacement for punyencode and punydecode, but then again - it was also just a learning experiment.

I would love to contribute to the Go package ecosystem at some point, when I had something of value and something worthwhile sharing, but for know it seems that just putting stuff on GitHub does the job, even though I am unsure as two how and when this is done, since all my Go repositories are not there at the time of writing, well it is not that big a deal since my stuff is made in the open and it would require for somebody to search for my name - but for somebody else, I guess this could be.

This is just my heads-up - if you experimenting with Go in the open, please be aware that you might be contributing to https://pkg.go.dev/, which might not be what you intended - I guess https://pkg.go.dev/ is more a indexer acting as a repository, than a repository which is also indexed.

Latest comments (0)