Configuring Google’s Pixelbook to Contribute to Go – Hacker Noon

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:

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 ..." to unstage)
        modified:   fmt/doc.go
modified: strconv/ftoa.go
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." 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 <[email protected]>
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
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: 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/

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.

read original article here