Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

Setting Up Golang on Manjaro Linux

Today we’re going to set up a Golang development environment in Manjaro Linux. It’s super easy.

I’ve been playing around with Manjaro a lot lately and it’s a pretty cool distribution, it’s based off Arch Linux, which I’m a huge fan of.

Step 1: Update the System

Golang on Manjaro

At your Manjaro desktop, open a command prompt. The first thing you’ll want to do is update the system.

We do that by typing in

1
sudo pacman -Syu

This will make sure your system is up to date.

Step 2: Install Golang

Next, install Golang

Type in

1
sudo pacman -S go 

you can verify it’s installed by typing in:

1
go version

Golang on Manjaro

So now I’m going to create a projects folder (/home/jeremy/Projects) and create a hello world to test this out.

Create a file named hello.go and put in the hello world code:

1
2
3
4
5
package main
import "fmt"
func main() {
    fmt.Println("hello world")
}

Save the file, and then build it with the following command:

1
go build hello.go

This will build an executable you can run named “hello”

if you run it, it should output your message:

Golang on Manjaro

Step 3: Install Visual Studio Code

Now the Version of Visual Studio code that I want is in the AUR. So we’ll install git.

1
sudo pacman -S git 

I like to create a sources folder for building AURs(/home/jeremy/Sources) but you can put it where you want. To run AURs you must clone or download them first.

I will go back to the AUR page and copy the git clone url and clone it:

1
git clone https://aur.archlinux.org/packages/visual-studio-code-bin/?O=10&PP=10

Next, run

1
makepkg -i

Golang on Manjaro

I’m getting this error, and you might too because this is a brand new Manjaro install so I haven’t installed the tools yet to make AUR packages.

To build AURs you’ll have to install some tools:

Type in

1
pacman -S base-devel

And you can choose 3 for bin utils, or enter for all. I’m going to install all because I’ll be building a lot of things on this machine.

Now run

1
makepkg -i

Golang on Manjaro

And we’re back in business.

Start Coding!

We load up visual studio code and now I’ll go back to that projects folder.

It recommends the go extension so we’ll go ahead and install it.

As you can see it recommends we install go outline.

We will just click on install all, and it will build in the dependencies we need.

Golang on Manjaro

Now this is all set up for us, it’s super easy.

We can even run and debug the file.

Now I’ve put some simple code here to add a couple numbers.

I’ll add in a break point and run it.

So it’s that easy to set up a go development environment in Manjaro. It’s simple and easy, so have fun and get to coding!!

Here’s a video covering the same thing:

If you’d like to learn more about Golang, check out Pluralsight’s courses on Golang today, there are tons of great courses to get you ramped up fast.

Intel’s Clear Linux: First Impressions

I’ve been using Linux since 1996, and I’ve used so many distributions I’ve lost count. In fact, I’m kind of weirdo about it. I love spinning up new distributions of Linux and testing them out.

It’s as if I drive a particular car every day for commuting but spend evenings and weekends test driving cars from dealerships just to see what they feel like.

How to Nail Your Next Coding Interview

The room is silent except for the buzzing of the fluorescent lights. The judges across the table are staring at you, expressionless. Some have pen and paper, some don’t. They’re all staring at you. Your mouth is so dry it feels like you’ve been eating sawdust all day. You grab the marker and head for the whiteboard. One judge is staring at a laptop. It’s time to show them a quicksort.

You Can Get the Source Code for Apollo 11 and Take a Course on It

In software development you’ll hear the term “moon shot”. If something is a “moon shot” it’s something that’s extraordinarily difficult, like landing on the moon. We say this about some app doing something cool, but what about the software that… landed us on the moon? What was the original “moon shot” all about? 

Thinking About Reusable Code

The mythical “reusable code” idea has existed for decades. It showed up shortly after the first lines of code were written. We preach re-usability and sometimes strive for it but it rarely becomes a reality. I’ve seen various levels of success with this over the years. Everything from “we have a reusable library that 75% of us use” to “we have shared code libraries here, but never use them in your projects”.

Transforming Your Organization With the Andon Cord

Imagine you’re working in a factory. You’re assembling Toyotas all day long, then your part won’t fit. What’s going on? You do this hundreds of times a day but now the bolts won’t go in. No reason to panic, you pull a cord to get help. Two co-workers arrive immediately. They find out you have a box of bolts with the wrong thread. They swap out the bolts, and you keep going.