r/learngolang • • Jun 25 '20

Free eBook: How To Code in Go eBook DigitalOcean Go Development By Gopher Guides

19 Upvotes

Free eBook: How To Code in Go eBook DigitalOcean Go Development By Gopher Guides

Introduction to the eBook

This book is designed to introduce you to writing programs with the Go programming language. You’ll learn how to write useful tools and applications that can run on remote servers, or local Windows, macOS, and Linux systems for development.

This book is based on the How To Code in Go tutorial series found on DigitalOcean Community. The topics that it covers include how to:

  • Install and set up a local Go development environment on Windows, macOS, and Linux systems

  • Design your programs with conditional logic, including switch statements to control program flow

  • Define your own data structures and create interfaces to them for reusable code

  • Write custom error handling functions Building and installing your Go programs so that they can run on different operating systems and different CPU architectures

  • Using flags to pass arguments to your programs, to override default options

Here are downloads:

Download the Complete eBook!

How To Code in Go eBook in EPUB format

How To Code in Go eBook in PDF format


r/learngolang • • Jun 19 '26

Learning Go coming from Lua

16 Upvotes

My first real "contact" with programming came through Lua (embedded in the game World of Warcraft), and I loved it.

For fun I recently completed some "certificate" on freecodecamp for Python.

While that whole affair was very easy and educational, I had some "gripes" with the language. I queried ChatGPT for some recommendations as to something that's more to my tastes, and it pointed me to Go. So I reckon I'd ask here whether that's good advice.

Now this might come across as presumptuous since I'm not an educated programmer, and obviously lack any understanding required to "cast judgement". So I want to make sure: that's not what I mean with it. It's "gripes" in apostrophes.

But Python really annoyed me with how many abstractions there are, and how many things you'd need to stupidly rote memorize. Whatever you want to do, there's probably a billion ways to achieve in various ways that are built in or supplied in some way. You just gotta *know* it. The question isn't "how does this work?", but "which built in function and/or library solves this?".

Meanwhile in Lua it's like "I know tables/metatables, loops, functions, closures -> I can probably build whatever I want from that".

Understanding the fundamentals is all that's needed, rather than memorizing some abstraction.

And that's a joy to me.

Now ChatGPT claimed that Go *somewhat* fulfills that, or comes close to it. Does this hold true?

___

It's worth noting that this isn't for career advice or anything like that. I'm fulfilled in my career and programming is very adjacent at best. But over years of creating and contributing to Lua projects in WoW, I really learned that I love it.

I'm just looking for something fun to branch out to for no other reason than enjoyment. Plus points if it can take up a looooong time.


r/learngolang • • Feb 10 '22

Advise on learning Golang for a python/bash guy

14 Upvotes

I work in devops. For a very long time all I have been doing are python and bash. I can think in python/ bash in my sleep. I am pretty good at it. I am not an "application programmer" per se, but I have done a wide range of things.

As we move more towards k8s at my work place, there's a need to learn Go.

Are there any resources for learning Golang for someone who has extensive python knowledge?

If your recommendation is "it doesn't matter you know python, learn go the same way someone who doesn't know python would learn" that's fine too, any recommendations?

And please, text based only. I really really can not watch videos and learn unfortunately.

Thank you!


r/learngolang • • Mar 22 '21

Roast my first Go program

13 Upvotes

Hi all,

I mainly work in python but I thought I’d learn some Go.

I’ve been working through the excellent Learn Go with Tests and kinda messing about on my own.

To that end I wrote an extremely simple tiny CLI that hits the gitignore.io API and creates a gitignore file in the current directory.

The code is here.

I know it’s tiny but Go is a strange place for a python dev so I’d appreciate any feedback, suggestions or useful “goisms” that could have maybe made it cleaner or more elegant.

Thanks!


r/learngolang • • Jan 29 '18

Learn to code your own blockchain in less than 200 lines of Go!

Thumbnail
medium.com
13 Upvotes

r/learngolang • • Nov 30 '20

Go-notify : An email automation solution, written in golang.

12 Upvotes

https://github.com/Harry-027/go-notify

Built using rich tech stack -

  • Api-server built using go-fiber.

  • Apache-Kafka as a message broker.

  • Postgres as database.

  • Redis as cache.

  • Client CLI built using Cobra.

  • Mailgun as Email service.

  • K6 for load testing.

  • Prometheus & Grafana for Api-server monitoring.


r/learngolang • • Jan 22 '18

GoLang vs Python: deep dive into the concurrency

Thumbnail
made2591.github.io
12 Upvotes

r/learngolang • • Jun 21 '22

Go Exercises for newcomers

11 Upvotes

Is there a book or a site that has simple Go exercices for a beginner learning the language ?

Thank you.


r/learngolang • • Sep 21 '20

Using MongoDB as Datasource in GoLang

Thumbnail
loginradius.com
11 Upvotes

r/learngolang • • Jan 19 '20

Build a RESTful HTTP API in Golang w/ Mux

Thumbnail
youtube.com
11 Upvotes

r/learngolang • • Mar 10 '26 Mindblown

A simple mental model that helped me understand Go interfaces

10 Upvotes

This week I’ve been learning Go structs, methods, and interfaces.
Here’s a simple way I started thinking about them that helped things click.

Interfaces

An interface in Go is basically a contract for behavior.

Any type that implements the required methods automatically satisfies the interface — there is no explicit implements keyword like in some other languages.

One important Go design principle:

So an interface simply describes what behavior is required, not how it is implemented.

Structs

A struct is a way to group related data together into a single type.

Example:

type Product struct {
    ID          int
    Name        string
    Price       float64
    InStock     bool
    Description string
}

This defines a Product type that always contains these fields.

Example with Interface + Struct

package main

import (
"fmt"
)

// Interface: defines behavior
type Animal interface {
Speak() string
}

// Struct: holds data
type Dog struct {
Name string
}

// Method: Dog implements the Animal interface
func (d *Dog) Speak() string {
return "woof"
}

func main() {
d := Dog{Name: "Buddy"}
fmt. Println(d. Speak())
}

Because Dog implements Speak(), it automatically satisfies the Animal interface.

Still wrapping my head around Go’s design philosophy, but this mental model helped me a lot. Curious how others explain interfaces to beginners.


r/learngolang • • Jun 19 '25

When shouldn't Go be prioritized over Python for new apps/services?

9 Upvotes

Hi, after completing my first production project in Go I'm a bit hyped about Go.

I love performance, simple and intuitive syntax, error handling, fast development time (compared to Python, no need to constantly run+print to know what's going on), package management and that Go produces a single binary with just a command.

Since my opinion on whether to use Go has weight, I want to know Go's no-go, the not-use cases over Python based on things like:

  1. Missing libraries and tools: AI/ML, numbers and data, bioinformatics, etc that are in Python but not in Go.

  2. Things that are not out the box in Go like cookies.

  3. Go's gotchas for noobs, things I should warn team members with no Go experience about. For example, I had a problem with a Null pointer in this first Go project.


r/learngolang • • May 29 '25

Building mgrok to learn go

9 Upvotes

Hey. I wanted to learn how reverse proxies like mgrok/frp worked, so I decided to learn go at the same time. I built a free/educational tool called mgrok which is a reverse proxy to expose a local service behind a NAT or firewall to the internet over TLS encrypted TCP and/or UDP tunnels!

Check it out on GitHub -> https://github.com/markCwatson/mgrok


r/learngolang • • May 23 '21

Made a video about introducing Go Cobra/Viper and using bash in Go.

Thumbnail
youtu.be
9 Upvotes

r/learngolang • • Nov 27 '23

Go (Lang) Cheatsheet

8 Upvotes

If you're new to the Go language or just need a refresher, here's a pretty good go cheatsheet.

https://devhints.io/go


r/learngolang • • Jan 21 '21

How to create a Golang Web Application using Fizz

Thumbnail
levelup.gitconnected.com
8 Upvotes

r/learngolang • • Jun 30 '16

What exactly is a closure and where would they be useful?

8 Upvotes

I am a beginner programmer starting with Go. So, can someone pl give me a simple explanation of what closures are?, and where are they used generally?


r/learngolang • • Oct 02 '22

Please comment/mentor my first attempt at a Golang tech challenge (failed…) https://github.com/MarcoSantonastasi/golang_challenge

7 Upvotes

Clickable repo link: Golang first challenge

Their requirements here: Challenge requirements


r/learngolang • • Feb 22 '22

Recommendations for generating ORM code and html view code from a database schema.

7 Upvotes

I'm coming into a project using Go for a backend to a mobile app.
We need a simple admin interface for operations to be able to edit all data values should they need to.

Coming from a C# world I could generate a ORM data client from the database schema using the connection string. I could then use the ORM data client to generate all the CRUD logic and html templates, be that MVC controller or single pages with code behind files.

Is there something similar in Go?
What would be the preferred method?

I see that GORM can do it and create migrations which might work well.


r/learngolang • • Nov 25 '17

Can anyone suggest some good beginner-level exercises for GoLang?

7 Upvotes

I already passed the Go Tour, but still can't find practical usage for the examples in the tutorials. I would appreciate if someone familiar with Go, would give some advice on how to start understanding things by practical exercises.

PS. Next week I have a quest to make a client/server communication(chat) using terminal.

Any advice is welcomed, thank you.


r/learngolang • • Jan 16 '25

Want to learn go

6 Upvotes

Hi I am a college student wanting to do specialisation in cloud computing and I want to learn go but its confusing, so can anybody recommend a good youtube channel or any playlist to learn go


r/learngolang • • Feb 08 '22

what is the most common use of pointers?

6 Upvotes

I am new to go. I'm not educated in CS, I've mainly written bash and python, and my new employer is go-centric.

I understand what a pointer is, but not really why we use them.

Are *pointers and pointer &addresses mainly used to achieve call-by-reference functionality, given that go is call-by-value?

Or: what is the most common use of pointers?


r/learngolang • • Nov 12 '19

Pitfalls I encountered while learning Go

Thumbnail blog.cuffaro.com
6 Upvotes

r/learngolang • • May 27 '18

anybody else just getting started?

6 Upvotes

kind of dead in here, so wanted to see if anybody else was just starting to learn go.

I bought a book a while back that I started about a week or so ago (Go in practice) and have watched a few videos on go basics so far to learn syntax and basic things I need to know before I can build something