Finding a contribution
The biggest challenge to contributing to Go, in my humble opinion, is to find a nice issue to work on. If you are like me and don’t have too much experience writing compiler code, I suggest you find a very simple issue to just test the process and progressively increase complexity of the issues over time.
You can find some nice first issues looking for the tag
help wanted and/or
Documentation . Here’s a link to one of such queries:
For the purpose of this article I’ve chosen the following issue: https://github.com/golang/go/issues/25082
As it seems the solution has been decided (change the docs), but no one has implemented it yet. Time to get my hands dirty. 🙂
Let’s create a new branch and initialize the contribution.
$ cd ~/golang/go/src
$ git checkout -b "danicat-25082"
Next I’ll edit both files to fix the comments.
$ code fmt/doc.go strconv/ftoa.go
Then it’s time to
git add :
$ git add fmt/doc.go strconv/ftoa.go
$ git status
On branch danicat-25082
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
Please note that I’m ignoring the hot fix I did to make the build pass as stated above, so I’m only committing
ftoa.go . I’m following Gerrit’s contribution flow, so I’m committing with
git codereview change :
$ git codereview change
And here’s my finished commit:
Author: Daniela Petruzalek <firstname.lastname@example.org>
Date: Wed Aug 1 00:19:55 2018 +0000
strconv: clarify "g" and "G" precision in the docs
Fix the wording in "strconv" and "fmt" to make explicit
that the "g" and "G" formats remove trailing zeroes.
Now it’s time to test the build again (just to be sure) and then submit the fix via
git codereview mail :
Building Go cmd/dist using /usr/local/go.
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/amd64.
##### Testing packages.
ok archive/tar 0.069s
ok archive/zip 2.197s
ALL TESTS PASSED
Installed Go for linux/amd64 in /home/danielapetruzalek/golang/go
Installed commands in /home/danielapetruzalek/golang/go/bin
*** You need to add /home/danielapetruzalek/golang/go/bin to your PATH.
$ git codereview mail
remote: Processing changes: new: 1, done
remote: New Changes:
remote: https://go-review.googlesource.com/c/go/+/127135 strconv: clarify "g" and "G" precision in the docs
And we are done! You may follow the link to see how it shows on Gerrit.
Now it’s up to the core team to approve and merge the commit or not, but in regarding to the process, everything that is needed to do a serious code contribution to Go was covered.
UPDATE: Wow, that was quick! And now (5 minutes later) it’s merged \o/
With this I conclude that indeed the Pixelbook is very capable of replacing my former personal laptop in regards to coding capabilities. VS Code runs smoothly and I haven’t found anything that is a deal-breaker. That weird bug with the file descriptor could have been a thing if I hadn’t created an workaround, but so far I don’t think it will become a bigger issue.