DEV Community

Jayson J. Phillips
Jayson J. Phillips

Posted on • Updated on • Originally published at

Learning How to Write Go REST APIs on a Pixelbook: Day 1

Well, I've seen a few folks post their experience on using some chromebooks as a lightweight web development tool, but what about building web services in compiled languages? Let's take our first shot at doing so with Go!

Well, I'm working on a project in golang, and I sold my trusty iPad Pro, because while it's an amazing tablet, it's not enough of a portable dev/entertainment machine that I'd like. I want to be able to leave the 15" MacBook Pro at home when I take flights or travel and I'm not gonna need all the power (read: and weight) of the machine with me.

Enter, used pixelbook. The awesome part about the iPad Pro was that it took less than 2 hours to find a buyer for it (it was in like new condition, under warranty, and I still had all the boxes, like a madman). Now armed with unexpected new cash, I turned around and procured a used, excellent condition, Google Pixelbook with the following configuration:

Core i7-7Y75 Processor

Now, I could have gotten by with a lower spec'd machine (Core i5/8GB), but I was concerned about the eMMC SSD (yes, it's solid state, but more akin to a fast embedded SD Card and not like the SSD in my MacBook Pro), and since I planned to do a lot of development in file-system heavy ways (oh, node_modules, also compilation of binaries in Go. Or Java. Or something else), I figured I might as well go with a spec I'm used to in my day-to-day dev life.

Pretty good pickup at $700 (I was eyeing the Pixelbook Go, but the max config w/ 16GB RAM is still pre-order only, the iPad Pro cash was burning a hole in my pocket... and y'all don't care about any of this. My bad).

So, I boot the thing up, and damn - I've only had one other machine in my life boot to a GUI this fast in recent years (my home linux NUC, that thing is a beaut).

Sign in w/ my Google account, and here we are.

Step one: Enable Linux in chrome://settings
Less than 10 minutes later, I have Linux enabled and a terminal prompt (would've likely been faster over a faster wifi connection - this one clocked in at 2.4Mbps, but I wasn't complaining. It was free and at my favorite coffee shop).

Step two: Install golang
Well, I downloaded the linux tarball from this link, and then wondered how I would access it in my terminal. Using the Files app, I right-clicked and shared it with Linux, and that... was it. Damn.

After that, we run a quick command to untar the package into my userspace:
sudo tar -xzvf -C /usr/local go1.13.4.linux-amd64.tar.gz and let it do its thing... pretty fast too. (If you're new to terminal or haven't dealt with tarballs often, that command translates to: "while using superuser privileges, untar this package into the path I specified in the -C option". Here's the manual pages if you'd like to get the actual definitions for each of the options.

Step three: Add the go command to my user's PATH
So, in order to make go accessible without me having to type /usr/local/... every time, we want to add it to our user's path. I did that with export PATH=$PATH:/usr/local/go/bin, and now all of the executables that come with golang's install are available to my user without needing explicit file paths. From there, I want to make sure this is always available, so I edit ~.bash_profile, and add that line to it. Then to make sure it loads, I type source ~/.bash_profile, and boom, it's there.

And now, my golang install is done.

Step Four: Fix something at work
This is where I'll stop the post, as I have to finish this setup later tonight, but I wanted to get this all down before I went to teach my class later tonight and forgot what all I did.

Tune in for part 2!

Top comments (2)

bradtaniguchi profile image

I use the i7 Pixelbook for work every now and then for TypeScript based web projects and found there is one part of the laptop that cuts down on my productivity the most, and its the CPU.

Here are the specs for the CPU's between the i5 and i7 models of the Pixelbook.

The base performance of the two are 1.20ghz and 1.30ghz respectively. Boosted the two CPU's get up to 3.30ghz and 3.60ghz, which sounds fine, except they are heavily throttled once the laptop gets hot, meaning less performance. Throw in the fact everything you do is in a VM, in a container the Pixelbook CPU isn't very fast when it comes to CPU heavy tasks. I could be wrong as I'm not a big hardware guy, but my Pixelbook just bogs down once I start working on larger projects.

Don't get me wrong I love my Pixelbook (my favorite laptop no doubt), but due to the CPU limitations it is far from the "be-all-end all" laptop I wanted it to be. It can still do everything my other laptop can do (which is an old i5 HP running Linux) just like 30% slower, and around 100% slower than my desktops.

I hope your experience working with a goLang based project is better than mine in terms of developer experience! If you don't mind slower load times, the Pixelbook will get it done (especially the i7 version) just don't expect it to run circles around a Macbook Pro 😄

jaysonjphillips profile image
Jayson J. Phillips

Thanks for the comment!

I have no expectation at all that this will replace my MBP for full dev and/or day to day work. However, there's times I just want to create some proof of concepts and/or self study code (or personal items), where I don't necessarily need the full MBP on my back all day.

To your point, the processor is a low-power dual-core Core i7, it's essentially the Macbook 12-inch with more RAM and a different screen. But it is also sooooo much lighter on my back lol.