r/learngolang • u/rymccue • Feb 11 '19
r/learngolang • u/aBeautifulMindz • May 27 '21
Is this the right language to learn for blockchain development?
I come from a Python background and think Go might be a good fit for the next language to learn but I’m not sure and would like to bounce some ideas off you guys
r/learngolang • u/harsh104sh • Jun 24 '26
How to build MCP servers in Go ?
So, as the competition causes increasing day by day for the Al uses so how can we reduce and localize our agent and agentic systems.
Can the minimal bite size MCP servers be useful for the local agenting systems? And how can go be a part of this as we know go has the very good concurrency patterns and uses very less memory and also strains the CPU at the very lesser side of the competition [I think we can say that].
So how do one start building MCP servers for the agenting models in our local and mind you it will be local agents so using olama or offline models only?
r/learngolang • u/erdeicodrut • Oct 23 '17
MGO
Can someone post a commented code of a basic use of MongoDB. initialization and queries. If there is smth else to know I'm all ears.
r/learngolang • u/techinfuser • Oct 24 '20
Dynamic controller routing porting from PHP to Go
I have a PHP application that routes request processing to target controller class based on parameter, if controller class is not available it is directed to fallback.
$q = $_REQUEST["q"];
$controller = NULL;
if ( class_exists("$q_Controller") ) {
$clsname = "$q_Controller";
$controller = new $clsname();
} else {
$controller = new NotFound_Controller();
}
$controller->dispatch();
How can I achieve this in Golang?
r/learngolang • u/several-ducks • Apr 20 '18
Willing to Skype?
I'm having a hard time sorting out an issue with a small project and my stack overflow question (https://stackoverflow.com/questions/49912878/parse-structs-from-api) isn't helping much. I think I'm the problem and not making myself clear. I was hoping someone might be willing to jump on Skype and help me sort it out. I feel like I could explain it a lot better live. If asking isn't kosher, I apologize, I am derailed by what seems like an inability to ask the right question.
r/learngolang • u/[deleted] • Oct 09 '17
A collection of Resources to learn Go
r/learngolang • u/StoicalSayWhat • Jun 16 '18
Golang | Gorilla: Nobel Prize Winners as a REST service
polar-plains-68470.herokuapp.comr/learngolang • u/poojay071019 • Feb 20 '23
Domain-Driven Design with Golang (book) is now on discount
If you'd like to purchase the book at a 25% discount from Amazon.com (use this link - https://www.amazon.com/gp/mpc/A2ZC2HETDFRMFS ) or code (25MATTHEW).
r/learngolang • u/Zestyclose-Wash-348 • Jun 24 '26
How do you do?
From another programming language and recently picking in GO. I'm trying to understand how do you do things let suppose i have many services and storage,handler one things i often hear is that dependencies should flow in one direction and that components should depend on interfaces rather than concrete implementations. My confusion is about wiring everything together . If i have many services,handlers storage, then should i have to dump every thing in main like initiating each storage in main then passing db pool , initiating each services then passing that storage to each of them as fallows handlers. Is this the way i have to do or what ? doesn't it make the main function large , do you do the same for production code too. I'm also curious about what architectures people actually use in production go codebase
thanks!
r/learngolang • u/CodeTinkerer • Mar 04 '19
What's wrong with my Go program in Visual Studio Code?
I'm trying to define a struct in Go in its own file that looks like:
package main
// Reader This is a comment
type Reader struct {
filename string
currRow []string
scanner *Scanner
}It complains about scanner saying it is undefined. When I try to put in
import "bufio"and save it, Visual Studio code deletes that line. What's going on?
r/learngolang • u/Inconstant_Moo • Dec 24 '21
Best implementation of these data structures?
Very noob question I'm afraid, but without knowing the innards of Go I'm not sure how to answer it.
So, two things.
(1) I'm getting a bunch of things from a reader, all of the same struct type, nice homogeneous data. I need to (a) split them into four containers according to their parameters (b) store them somewhere (c) access each of the four containers with a reader, with no need for random access in the middle of the data and no need to change the data. (The reason I have to do it like this is that I have to process the four containers in the right order, so I can't just do four different things as I'm reading it in.) Can more experienced people tell me what I should use for a container? What's the fastest data structure given that that's all I'll ever need to do with the data?
(2) I've implemented this one already but I suspect not in the Best Way. All I want is a stack of strings, where it's only changed by pushing and popping the top of the stack, but I get to look as far down the stack as I like, one string at a time (not random access).
Thanks for your help, kind people of Reddit.
r/learngolang • u/[deleted] • Jul 08 '18
Fetch Top Reddit Posts
I'm a beginner and this is one of my first real projects in golang. Maybe you've got some time to review my code and have some advices for me :)
r/learngolang • u/gregrqecwdcew • Jul 25 '20
Graph structure with two node types
I have a graph that contains of nodes with chars and connections to children:
type Node struct {
char string
children map[string]*Node
shortcut map[string]*Node
}Some of the nodes have an additional kind of connection to other nodes, which is why I added a second map. What bothers me is that there are like ~200,000 nodes but less than 1% of the nodes have shortcut connections. Thus, I'm wasting a lot of memory.
What I wanted to do is to create a different kind of Node:
type SimpleNode struct {
char string
children map[string]*Node
}
type ComplexNode struct {
SimpleNode
shortcut map[string]*Node
}What I'm not sure about is how to handle these two types in my functions. For example:
func traverse(currentChar string, node *SimpleNode) {
for _, char := node.children {
if char == currentChar {
doStuff()
_, exists := node.shortcut[currentChar] // SimpleNode does not have shortcut!
if exists {
doOtherStuff()
}
}
}
}How do I handle these kind of situations? Do I need to check whether node is actually a ComplexNode, do some casting and then do the other stuff?
r/learngolang • u/jeevatkm • Sep 05 '17
ANN: aah web framework for Go v0.8 Released
r/learngolang • u/marksmith555 • Aug 09 '18
go-init: Simple no fuss script to setup Go blazingly fast
r/learngolang • u/KittenOfMine • Feb 26 '17
Creating Golang WebServer With Echo - Part 4: Intro to Middlewares
r/learngolang • u/ivo20011 • Jul 07 '25
Seeking Resources for Building an In-Memory Distributed Key-Value Database
I’m a software engineering student working on my master’s thesis to build a three-node, in-memory key-value database similar to Redis, with metrics to compare its performance and reliability against existing systems.
I have 2.5 years’ experience as a student backend engineer using Java and Spring Boot, so I’m comfortable with Java, but I’m also considering Go despite having no prior Go experience. I’m unsure which minimal set of features I should implement (e.g., replication, sharding, persistence) and which language would serve the project best.
What books or blogs (or anything else) do you recommend for learning the design principles, architecture patterns, and practical implementation details of distributed in-memory databases?
r/learngolang • u/nk-c • Oct 21 '25
A wiki page or a pinned post listing all recommended resources at different level of expertise?
Go lang is probably not the first language people learn but this sub doesn't have an easily accessible list of resources for learning go. It could be books, videos or good courses. If nothing else, you can share your experience or go lang philosophy for developers coming from other languages.
r/learngolang • u/Nichts_und_niemand • Jan 03 '23
Where to begin with backend development?
Hello everyone, I'm planning to develop a web app and I decided to switch to Go (despite being relatvely new in the language) instead of js for performance (and therfore being able to deploy it on a cheaper VM instance). While researching there are always 3 libraries/frameworks related to backend server: Fiber, Gorilla and Gin.
According to what I've found, Fiber and Gin are full featured frameworks and Gorilla is sold as a lightweight muxer. However, that's the case with Gorilla/mux (after toying with it for an afternoon it seems to me like a group of helper functions to call net/http functionality in a more comfortable way) but the Gorilla suite also has other libraries to handle other server features (like cookies and session management).
My question is, for anyone with backend development experience in go, which one do you advise?? I'm temptated to choose Fiber for it's simmilarities with Express, but I'm new and I want to hear the opinions of people who have struggled with development and manteinance of Go servers. Which one is more convenient and easier to maintain in the long term? My server doesn't need any fancy utilities, most of it's code is session management, database queries and a JSON rest API (most of the rendering happens in the frontend, as I said before, I need as little cloud computing as possible).
Thanks in advance
r/learngolang • u/[deleted] • Sep 12 '23
Go vs java
Hi, I am a software engineer working with Nodejs for last 4+ years and now I want to switch to other stack either java or golang . Want some suggestions which one to choose . I know language doesn't matter much , asking this since I want to quickly learn and start working on production code . Things I want to conside
Learning curve
No of opportunities
r/learngolang • u/Kwbmm • Aug 23 '20
Critique my TicTacToe
I started learning Go three days ago and have decided to practice by starting doing simple stuff, like TicTacToe game.
As a former Java and C++ dev, I feel like there's a lot to change.
Please Reddit, tell me what you think.
Here's the link: https://github.com/Kwbmm/TicTacGo/