The Accidental Go Package Repository Contributor
Tags: go, repo, opensource
Published: 2022-07-04 12:30:32

---
title: The Accidental Go Package Repository Contributor
published: true
description: The go package repo actually indexes your stuff
tags: go, repo, opensource
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
I recently found out I had _stuff_ on [https://pkg.go.dev/][GOPKGDEV], _the_ Go package repository.

Apparently the repository is updated automatically from: [https://proxy.golang.org/](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](https://pkg.go.dev/search?q=jonasbn):

- 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](https://metacpan.org/search?size=20&q=jonasbn) and I believe this was what surprised me. [CPAN/PAUSE](https://pause.perl.org/pause/query?ACTION=pause_04about), like [Rubygems](https://guides.rubygems.org/publishing/), [NPM](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry), [NuGET](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package), [Crates](https://doc.rust-lang.org/cargo/commands/cargo-publish.html) 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/][GOPKGDEV], 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](https://github.com/jonasbn/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](https://dev.to/jonasbn/til-colorful-test-output-in-go-3k86) 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](https://github.com/jonasbn/punyencode) and it's cousin [punydecode](https://github.com/jonasbn/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](https://github.com/jonasbn/punycode), a tool which can handle both encoding and decoding punycode, since parsing a string can tell if it already [punycode](https://en.wikipedia.org/wiki/Punycode) or not.

So these packages listed on [https://pkg.go.dev/][GOPKGDEV], 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/][GOPKGDEV] is possible according to [the documentation](https://go.dev/about#removing-a-package), 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](https://pkg.go.dev/about#adding-a-package), 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](https://github.com/jonasbn/punycode), which is the replacement for [punyencode](https://github.com/jonasbn/punyencode) and [punydecode](https://github.com/jonasbn/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/][GOPKGDEV], which might not be what you intended - I guess [https://pkg.go.dev/][GOPKGDEV] is more a indexer acting as a repository, than a repository which is also indexed.

[GOPKGDEV]: https://pkg.go.dev/