Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 255460

Go, commonly referred to as "golang", is a fast, statically typed, compiled language created by Google. The language was initially developed as an alternative to C++ for server infrastructure and has native support for concurrency.

2 votes
Accepted

Parse data into struct efficiently by reducing memory footprint

It's important to have a benchmark before you start trying to optimize the code. That being said, I can think of a few general recommendations. The ProductInfo.Name field is a nested map, this will r …
rose's user avatar
  • 325
1 vote

Using classes for X number of config files which needs to be read individually in memory

Keep in mind that Go is not an "object-oriented" language, and does not have classes. It is a slight conceptual shift to think about structs as data, rather than a way to organize code. …
rose's user avatar
  • 325
1 vote

DelayQueue in Go

To demonstrate with a little bit of code: func Put(queue chan interface{}, data interface{}, delay time.Duration) { go func() { <-time.After(delay) queue <- data }() } func Take … I also want to recommend reading through the presentation rethinking concurrency which lists many invaluable concurrency patterns for a go programmer. …
rose's user avatar
  • 325
1 vote
Accepted

Chunk output into files, based on number of entries and total size

Your code is very clear and readable in general. I came up with a very nitpicky list of style suggestions :) A few comments on main() time.Duration(1000) * time.Millisecond can be written as just 100 …
rose's user avatar
  • 325
1 vote
Accepted

Re-usable worker pool classes

This next comment comes from the rethinking concurrency presentation so I would recommend reading through that as it has a lot of other great concurrency patterns for go. …
rose's user avatar
  • 325
4 votes
Accepted

Download artifacts using HTTP

First I want to say that your code is very well written and idiomatic for someone who is new to Go. …
rose's user avatar
  • 325
2 votes
Accepted

Read bunch of files in parallel and populate concurrent map

However, in go, goroutines are lightweight and already distributed across OS threads, so it makes less sense to limit the number of threads in this way. …
rose's user avatar
  • 325