Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Basics of Go in Fedora

March 17, 2017
Jakub Čajka
Related topics:
Go
Related products:
Red Hat OpenShift

Share:

    Why use RPMs (distribution packages in general) at all ?!

    Distribution RPMs enables you to get signed curated content, with security updates, bug fixes, general updates, some level of testing, and known ways of reproducing the build locally. Of course, it has its cost mostly in the package size overhead and packaging infrastructure overhead (yum, dnf, apt....).

    Why package and use distribution (Fedora) packages?

    This helps to manage a stable subset of the go world. As many upstreams do not provide release nor API stability. In the current situation, package rebase and API stability is driven by consuming the project in a de-bundling effort lead by Jan Chaloupka and his tooling project Gofed which is still in "draft state",  Fedora golang packaging guidelines. This should lead to better possibilities for security bug fixes and assessment of the impact of those, as common vendoring/bundling and static linking in Go makes it really hard track this down. So there are still no general API guarantees apart of the base standard library.

    What is different in Fedora's golang?

    Fortunately, nothing is removed anymore. Before there was patch removing elliptic curve p224 while awaiting review of its fitness from Fedora Legal team. The review concluded last year and nowadays nothing is missing from Fedora's golang in any supported release. Also, there are few additional bits. First, since there is the possibility of go1.8 to override default crash traceback level to "crash" level at build time, using build tag "rpm_crashtraceback" and in older versions of golang not supported by upstream and still supported in Fedora, there are backports of security fixes.

    How to install Fedora golang?

    To install golang just use "dnf install golang", this will install the golang compiler (aka GC), a basic set of sub-packages, golang package with files like VERSION, API files,...a golang-src package with source files, excluding test sources and golang-bin containing compiler and basic tools binaries. To get complete upstream like a tree you need two additional sub-packages, golang-tests containing all standard tests and golang-misc. containing entirely upstream misc. directory (including more tests among other things).

    There hasn't been any mention of two sub-packages, golang-race containing prebuilt std lib with race detector enabled (available only on x86_64/amd64 platform, since go1.8) and golang-shared containing prebuilt standard library in form of dynamically linkable object file.

    All of this lives in the GOROOT directory, which is located under /usr/lib/golang/ on all architectures. The standard GOPATH for distribution packages, which is not set in the environment by default, is /usr/share/gocode. This is where you will find the source code for all non-standard library packages provided by the distribution (mostly in *-devel sub-packages).

    Workspace setup

    For your own Go workspace, you should use your own path or, since Go1.8, the implicit ~/go directory. Of course, you can use the distribution path, but in that case, it will be much harder if you decide to develop against libraries provided by the distribution or get projects that are already provided in distribution and installed locally. The best solution, in this case, is to have to have your own workspace and possibly use distribution libraries by setting multiple directories in the GOPATH env variable like "GOPATH=/my/go/path:/usr/share/gocode". This will cause other packages to be "go get" into the first directory, but all listed directories will be searched for build dependencies.

    With this you should be set for your go project development, just go get it or start it from scratch.


    As a developer, you can get a no-cost Red Hat Enterprise Linux Developer Suite subscription, which includes Red Hat Enterprise Linux 7 server, a collection of development tools, and much more.

    Last updated: March 20, 2023

    Recent Posts

    • Migrating Ansible Automation Platform 2.4 to 2.5

    • Multicluster resiliency with global load balancing and mesh federation

    • Simplify local prototyping with Camel JBang infrastructure

    • Smart deployments at scale: Leveraging ApplicationSets and Helm with cluster labels in Red Hat Advanced Cluster Management for Kubernetes

    • How to verify container signatures in disconnected OpenShift

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue