Skip to main content

Questions tagged [go]

Go, also called golang, is an open source programming language initially developed at Google. It is a statically-typed language with syntax loosely derived from that of C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.

Filter by
Sorted by
Tagged with
5 votes
2 answers
1k views

I'm trying to get hands-on experience with Uncle Bob's Clean Architecture in Go, but I'm running into some issues. Also, I'm not yet familiar with all of Go's idioms. For testing purposes, I'm ...
Crite's user avatar
  • 61
1 vote
1 answer
113 views

The title Go, Error Handling, and Big Text Files is a blog post from Wesley Aptekar-Cassels from 2021. In this blog post he reports about a problem he faced parsing long text files. He tried scanner :=...
surfmuggle's user avatar
1 vote
1 answer
259 views

As far as I understand (not much), the archival .a file is just, roughly speaking, the collection/batch of object .o files. It's like a library of compiled code that can be cached and which can be ...
LeaBit's user avatar
  • 151
1 vote
1 answer
134 views

I have a process in golang that I want to kickoff through a RPC call but then have the function return early whilst the process continues in the background. Specifically it’s just a basic db transfer ...
Person1's user avatar
  • 21
1 vote
0 answers
134 views

Had a discussion today in how to implement services that work with messages coming in from event queues. We call these services processors. One of us argues for using several functions, while the ...
Albert Balbastre-Morte's user avatar
1 vote
1 answer
215 views

I am working on a Go application where two concurrent maps, products and productCatalog, are accessed by numerous threads in live traffic to retrieve data at high throughput. These maps are populated ...
dragons's user avatar
  • 121
1 vote
2 answers
1k views

What would the appropriate design pattern to avoid deadlock when several functions use the same mutex ? It is quite easy to forget what method uses the lock and so it happens that you call a function ...
cylon86's user avatar
  • 111
3 votes
1 answer
395 views

I have read this article which indicates a double tuple structure, but it is unfortunately light on implementation details, which is what I am looking for. So... how are interfaces implemented in Go? ...
SRNissen's user avatar
  • 161
1 vote
1 answer
362 views

I have a little bit of experience with Go, that I have been trying to use as a reference point to wrap my mind around Rust via a cards game I wrote in Go that I would like to now write in Rust. I know ...
Daniel's user avatar
  • 119
1 vote
1 answer
435 views

I’m trying to test concurrently request (brute force test), with 1000 request/sec (same request id). I’m using Rest API. The service running on distributed system, I’m using 3 pods. The problem is I ...
Abyan Juang Kecci's user avatar
-3 votes
1 answer
169 views

I previously asked this on StackOverflow, but doesn't fit there and I was suggested to move it here. I was thinking about using two seperate backend languages for seperating concerns in a project of ...
HackXIt's user avatar
  • 97
0 votes
2 answers
1k views

In trying to separate interface from implementation, I ran into a circular dependency problem. There is a best practice in the world of Java: consume interfaces instead of concrete classes. That is, ...
selamba's user avatar
  • 109
2 votes
4 answers
1k views

I have a utility function called connectToMongoDB() which connects to MongoDB. Basically, it creates a client for MongoDB and returns that. I'm making a library and I'm thinking of unit testing the ...
DaCool1's user avatar
  • 37
1 vote
0 answers
182 views

I need some help with my authentication design. Happy to share any code as needed... Overview I have implemented the Google Sign-in (new web implementation here) button in my client web application. ...
Zack Shainsky's user avatar
4 votes
2 answers
363 views

I have a class (as a protobuf) OrderChange, that represents when an order (imagine Amazon.com) changes: message OrderChange { Order old_order = 1; Order new_order = 2; } message Order { ...
onepiece's user avatar
  • 169
0 votes
2 answers
2k views

I have moderate Golang experience and lots of experience in other programming languages such as Java, Python, Rust, Scala, and others. I'm comfortable with building REST services and most of the other ...
Naftuli Kay's user avatar
  • 1,621
0 votes
0 answers
217 views

We have set of common types (mostly structs, scalars, string IDs) that are used across different packages in a project written in Golang. Currently we define them in a package named "models" ...
oare234's user avatar
-3 votes
1 answer
426 views

In Programming Distributed Computing Systems: 7.3.4 Distribution Distributed computing is inherently concurrent. However, distribution aspects go far beyond concurrency. Of particular importance from ...
Tim's user avatar
  • 5,555
67 votes
9 answers
9k views

Java has "checked exceptions", which force the caller of the method to either handle an exception or to rethrow it, e.g. // requires ParseException to be handled or rethrown int i = ...
Heinzi's user avatar
  • 9,868
2 votes
1 answer
158 views

A project is structured as so: A build server listens to changes in two repositories: a frontend and backend repo. When it picks up a change it builds, tests, and deploys the updates to a production ...
Coupcoup's user avatar
  • 220
0 votes
1 answer
92 views

With a single publisher(go-routine) and multiple subscribers(go-routine) on same machine, below message hub help create pubsub model: type PublisherHub struct { subscribers map[*subscribmediator....
overexchange's user avatar
  • 2,315
0 votes
1 answer
639 views

I have a microservice architecture running on Heroku. I am having some problems handling race conditions. The problem is, that service A: Needs to fetch the user's balance through an API call to ...
Harald Nordgren's user avatar
1 vote
0 answers
80 views

I am currently writing a quiz web-app with a React front-end and a Golang backend, with a PostgreSQL database to keep track of the quizzes, the questions on the quizzes, and the choices in the ...
Eddie Hatfield's user avatar
1 vote
0 answers
54 views

Solution as it is right now I have this solution where I gather information from a proprietary product of a different company in various sites. The solution is based on a single go binary that ...
Marged's user avatar
  • 235
1 vote
2 answers
169 views

I'm working on a project that uses PubSub(GCP), my question is not specific to GCP, it's more regarding to the architectural pattern(I'm used to statically typed languages, and I have a hard time ...
alex's user avatar
  • 21