Configuring Google’s Pixelbook to Contribute to Go

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:

https://github.com/golang/go/issues?page=3&q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22

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"
$ go-init-contrib

Next I’ll edit both files to fix the comments.

$ code fmt/doc.go strconv/ftoa.go

Here’s the diff:

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)
 modified: fmt/doc.go
modified: strconv/ftoa.go
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)
 modified: ../misc/cgo/testcshared/main2.c
modified: ../misc/cgo/testcshared/src/libgo2/libgo2.go

Please note that I’m ignoring the hot fix I did to make the build pass as stated above, so I’m only committing doc.go and 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:

commit dedfb924340eeef2e3a66ac29aaac8d779eaf7c1
Author: Daniela Petruzalek <daniela.petruzalek@gmail.com>
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.
Fixes #25082
Change-Id: I2e2ad0a98d2ea27a3a8a006a0563b366f7a3b71b

Now it’s time to test the build again (just to be sure) and then submit the fix via git codereview mail :

$ ./all.bash
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:
remote: New Changes:
remote: https://go-review.googlesource.com/c/go/+/127135 strconv: clarify "g" and "G" precision in the docs
remote:

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/

It’s always nice to get a +2 from Rob Pike =)

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.

Facebook Comments

More Stuff

Slack’n Go: Batch Presence Aware Bot We shall create a Slack Bot in Go which aware of Batch Presence change event. Essentially we are going to build and run the example given here: https:...
17/08/2018: Biggest Stories in the Cryptosphere by BlockEx1. California-Based Judge Orders Defendant To Pay Bail With Crypto Following a charge of hacking the computer network of a game compan...
Perl-ing 101 & GIT Training Forever aspiring to evolve and learn more, some of our team got a chance to intensively learn about Perl over four solid days last April, followed by ...
Git Version Control Series: Setting Up Git This is the fourth in a series of blog posts around Git and a new feature in version 72, Git Version Control.  See the full list of entries in this se...
Spread the love

Posted by News Monkey