Blog

Manjaro Linux Go Setup: A Clean Walkthrough for Beginners

Setting up Go on an Arch-based distro doesn't have to be a chore. A straightforward Manjaro Linux Go setup can be wrapped up in an afternoon, even if you've never touched the command line beyond basic file management. The trick is following the right order: update the system, install the language, then add a proper code editor with Go support.

According to jeremymorgan.com, the process reduces to three practical steps on a fresh Manjaro machine. Below is a clean run-through based on those steps, with explanations for what each command actually does and why it matters.

Quick take:

  • System update via the command line to bring Manjaro current.
  • Go installed through the package manager, then verified.
  • A Hello World test build confirms the toolchain works.
  • VS Code pulled from the Arch User Repository (AUR) using git.
  • Build tools installed so AUR packages can actually compile.
  • Go extension added in VS Code to enable build, run, and debug.

Update the System Before Anything Else

Linux distros ship with stale package lists. Skip the update, and you'll chase phantom bugs later. Open a terminal on your Manjaro desktop and run the system update command. This refreshes the package index and rolls in newer versions of what's already installed.

This step takes a few minutes the first time, depending on how long since the last refresh. Rebooting is optional at this stage, but it never hurts after a major update.

Install Go and Prove It Works

With the system current, install Go using Manjaro's package manager. The reference walkthrough notes you can verify the install by checking the Go version, which is a habit worth keeping. If the version number prints back, the compiler is wired up.

Next, create a dedicated projects folder. Drop a simple hello.go file inside it containing a minimal main package that prints a string. From the same directory, build it with the Go build command. You should see an executable named hello appear in the folder. Run it. If "hello world" shows up on screen, the toolchain is functional.

This is also the moment to set your GOPATH and add Go binaries to PATH if the package didn't do it automatically. Nothing fancy, just exporting the usual variables in your shell profile so future go install commands land somewhere useful.

Bring In VS Code From the AUR

The version of VS Code that most users want isn't in Manjaro's default repositories. It lives in the AUR, which means you'll be building it from source. The AUR, or Arch User Repository, is a community-driven collection of package build scripts for Arch-based systems like Manjaro.

Start by installing git if it isn't already, then create a sources folder where you'll clone AUR packages. Pull down the Visual Studio Code package with git clone using the URL from its AUR page. First attempts to build usually fail on a fresh Manjaro install because the base-devel tools aren't present. Install them, choosing option 3 for the binary utilities at minimum, then rerun the build. The package compiles cleanly and installs.

Wire Up the Go Extension in VS Code

Open the projects folder in VS Code. The editor will recommend the Go extension immediately. Install it and let it pull in the supporting tools. The reference notes that prompts will appear for things like Go Outline, a tool that gives you a navigable function list in the sidebar. Click through and install all. That's the boring step that pays you back every time you write Go.

With everything in place, you can build, run, and debug directly from the editor. Drop a breakpoint on a line, hit the run button, and the debugger stops where you'd expect.

Worked Example: A Two-Number Adder

Say you've just finished the setup and want to confirm breakpoints actually work. Open the projects folder in VS Code, create a new file called adder.go, and write a tiny program that defines two integers, adds them, and prints the result. Set a breakpoint on the addition line. Run with the debugger.

Execution halts on that line, the locals panel shows both variables with their current values, and stepping over advances to the print statement. That single cycle proves the toolchain, the editor integration, and the debugger are all talking to each other properly.

Bottom Line

A clean Manjaro Linux Go setup is mostly sequencing. Update first, install Go next, then layer VS Code on top through the AUR with build tools available. Skip any of those and you'll spend an evening wondering what broke. The whole thing fits comfortably under an hour on a modern machine.

Key takeaways

  • Always run a full system update before installing new development tools.
  • Verify Go works with a Hello World before adding editor polish.
  • Install base-devel tools before your first AUR build, or every build will fail.
  • Use the VS Code Go extension's "install all" prompt to grab supporting tools.
  • Set breakpoints early in any new setup to confirm the debugger actually works.

Frequently asked questions

Do I really need to install Go from the AUR?

No. Manjaro's default repositories carry a current Go version, and using it skips the source build step. The AUR path is only relevant if you specifically want VS Code handled that way.

Why did my first AUR build fail?

Fresh Manjaro installations don't ship with base-devel, the group of compiler tools AUR packages need. Install it and the build proceeds normally.

Can I use a different code editor?

Yes. Go works with anything that can invoke go build, including Vim, Neovim, Sublime Text, and GoLand. The VS Code path is popular because of the Go extension's integrated debugging.

Is Manjaro a good pick for Go development?

It works well. You get rolling releases, recent kernels, and access to the AUR when you need packages outside the main repos.

Related