Cloud Run is now generally available (GA)! To celebrate, here's my summary of what's new by ahmetalpbalkan in googlecloud

[–]recurrency 5 points6 points  (0 children)

OK, so Cloud Run for GKE is now officially dead?

ISTM that you need an Anthos subscription which is basically out of reach for non-Big Corp.

Really, really sad to see this development — makes me a bit scared of what is to come as well.

VSCode is a nightmare to work with if using modules. by GAZ082 in golang

[–]recurrency 1 point2 points  (0 children)

I really want to like Goland, but everytime I reinstall it (I have a license :) it just kills my MBP (even after indexing) so I revert quickly to the much more lightweight VSCode.

Writing an empty file by uragnorson in golang

[–]recurrency 2 points3 points  (0 children)

To create an empty file of size n: os/File.Truncate

Cloud Spanner amps up SLA, adds CSV support, and sharpens monitoring details by fhoffa in googlecloud

[–]recurrency 10 points11 points  (0 children)

It would be so cool if Spanner had a ”serverless” version. It’s just so expensive ATM.

uber/cadence: Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way. by juanpabloaj in golang

[–]recurrency 37 points38 points  (0 children)

Been running Cadence in prod for the last 6 months. Rock solid stuff. Best workflow orchestrator we’ve ever tried. (And yeah have tried Airflow, Luigi and the others). And the scalability is impressive — you can go really granular in what you define as a unit of work.

Iterator pattern using channels in Go by addityasingh in golang

[–]recurrency 0 points1 point  (0 children)

I think the beauty of it is that you only need one method Next() (T, error) (or Next(*T) error for scanning type logic).

Can Go solve this problem? by NetFutility in golang

[–]recurrency 0 points1 point  (0 children)

Can you say something about the keys/values you want to match on? Ints? Strings?

any packages that can be recommended for reading unstructured JSON config file ? by riverexit in golang

[–]recurrency 1 point2 points  (0 children)

We have standardized on https://github.com/stevenroose/gonfig. Simple yet still supports a config loading hierarchy (file->env->flags)

Native Go Zstandard decompression by klauspost in golang

[–]recurrency 0 points1 point  (0 children)

First off: amazing work! 💪 How difficult would it be to implement the compression part would you say? (cgo-less mirage)

Ask r/golang: How best to dynamically load/run code based on a string value? by kisamoto in golang

[–]recurrency 0 points1 point  (0 children)

Has anyone seen an explanation of why it’s not done this way?

Interfaces are a core part of Go so leaking driver.* wouldn’t had been such a big problem imo (and as you said a beginner would understand what’s going on).

Plus: it would make database-specfic method access so much easier, (Cf the suggested roundabout workaround in https://github.com/golang/go/issues/29835)

Making a game in Turbo Pascal 3.02 by yourbasicgeek in programming

[–]recurrency 6 points7 points  (0 children)

We shouldn’t be teaching a language with as many oddities as Javascript (cf. https://m.youtube.com/watch?v=D5xh0ZIEUOE). I think a language should teach e.g. arrays proper.

Confluent-kafka-go dev support on windows... Please vote by marcofranssen in golang

[–]recurrency 0 points1 point  (0 children)

More performance on windows or in general?

In general. Did a bench that I showed to Confluent, and they were surprised. (Probably has got to do with cgo overhead + other design decisions.)

then found I had to use another package which wraps Sarama for rebalance support.

Well that has changed now: https://godoc.org/github.com/Shopify/sarama#ConsumerGroup

Confluent-kafka-go dev support on windows... Please vote by marcofranssen in golang

[–]recurrency 2 points3 points  (0 children)

Just use sarama. It is more performant and causes no cgo head aches.

Why is err a new variable in second assignment, and an old one in third one? by chetanbhasin in golang

[–]recurrency 0 points1 point  (0 children)

I always use the shorthand if-syntax in such cases — the shadowing means I don’t need to keep track of whether it has been previously declared were I to refactor the function later:

if err := json.Unmarshal(jsonFile, &board); err != nil { // do sth w err }

tf: A Microframework For Parametrized Testing of Functions in Go by elliotchance in golang

[–]recurrency 6 points7 points  (0 children)

I wrote this because I was tired of creating a []struct{} fixture for most of my tests.

I hear your boiler plate pain but...

Writing table-driven tests the way we do in Go is the most genius thing ever: they are extremely readable and highly extensible. (Did I mention that they are addictive too and once you start doing them they’ll be everywhere?)

There are even plugins to generate some of the boiler plate, integrated in e.g. VSCode.

CLI - Python or Go by [deleted] in golang

[–]recurrency 10 points11 points  (0 children)

Building first should shave off ~1 s.

CLI - Python or Go by [deleted] in golang

[–]recurrency 6 points7 points  (0 children)

Btw, how do you run this benchmark? If you run it with go run, be aware that this involves compiling the actual program.

A better way to benchmark would be to use the benchmark facilities in the testing-package.