Discover and read the best of Twitter Threads about #golang

Most recents (14)

While re-reading the paper "Fast key-value stores: An idea whose time has come and gone"…, I recalled "groupcache" from @bradfitz to speed up Chrome's; part of the "loan a Gopher out" program.

It was very influential for #golang 1/
groupcache… is a cache filling and caching library that lives within your application and talks to it's peers, exchanging values during cache misses aka "peer filling" and preventing thundering herds (that plague Memcached -- also from @bradfitz 💡) /2
I believe that before Kubernetes and Docker popularized the usage of #golang, Brad's work showed the huge and direct business+ engineering benefits of writing infrastructure in #golang. He noticed that written in C++ was slow & in massive tech debt /3
Read 13 tweets
Can you imagine the meltdown on the #golang github issue if append were being proposed today?
"append() seems too magical. Isn't Go supposed to be a simple language?"
"I think append should be a keyword. s = append s, x is obviously better."
Read 9 tweets
IMO there are two major problems with the #golang proposal to add a `try` builtin, which make it a non-starter.

First: as a rule, functions should annotate errors before returning them. `try` implicitly discourages that good practice.
Second: right now, there are precisely two ways to exit a function: `return`, and, exceptionally, `panic`. `try` adds a third way, which is likely to be deeply or repeatedly nested in other expressions, making return analysis more difficult.
`try` feels bolted-on, a little mechanism added to the machine to solve a specific nit, but which doesn't compose nicely or orthogonally with the other parts. In short, it feels un-Go-like.
Read 6 tweets
Number of times a certain element x is extracted first from a #golang map with 1000 elements. Yup, heavily skewed: if you care about extracting fairly a random element from a map do *not* use `for i := range m { return i }`.
Sure, the language spec just says iteration order is undefined, but I've seen people say that "it is random", as it appears so.
Read 3 tweets
#Java's death will be due to SEO mess, lack of centralized docs, outdated tutorials & no one-stop-shop place to find it all


This site was supposed to be the answer, but it only raises even more questions. The information here is mostly marketing-related, and has pointers to other online locations, outside

Potential: very high.
Reality: waste of TLD.

The Java source, no doubt. Yet, devs who want to just learn/code Java apps will only find binaries downloads. Nothing else serves the average Java software developer. "Developer's Guide" is for contributors.

Potential: high.
Reality: confusion.
Read 8 tweets
(0/3) A brief tour of CertMagic's high-level #golang API: the trifecta HTTPS(), Listen(), and TLS() functions, in 3 tweets.…
(1/3) Serve a #golang web application over HTTPS in one line, without ever touching certificates again -- use this instead of http.ListenAndServe():

err := certmagic.HTTPS([]string{"example\.com"}, handler)
(2/3) Get a #golang net.Listener that serves TLS, obtains and renews certificates during the lifetime of the program, staples OCSP responses, and shares resources in a fleet -- use this instead of tls.Listen():

ln, err := certmagci.Listen([]string{"example\.com"})
Read 8 tweets
A thread about representation:

I'm a @NotreDame alum. I love my alma mater, & every season I cheer for my beloved #FightingIrish in multiple sports. But one day 7 years ago, a question came from my 7-year old daughter that changed how I look at things forever
You see, we (my husband @Professor_Andoh also attended ND... twice over for both undergrad + grad) have tons of #NDAthletics merchandise. Hats, T-shirts, sweats, sandals, scarves. You name it. And we bought much of this in pint sizes for our kids... a proper indoctrination.
All of this merchandise is emblazoned with the classic ND fighting Irish leprechaun, shown here.
Read 25 tweets
Another packed room for @xaprb's #golang databases talk at #AllThingsOpen
Go is great for building services! Its syntax is pretty lightweight and easy to use. - @xaprb #AllThingsOpen
Go uses interfaces, which allows you to compose functionality, which is nice. #AllThingsOpen
Read 25 tweets
Adapted from @_rsc's… , which contains a prime sieve written in shell, but it's broken. I fixed it:

read p || exit
echo $p
while read x; do
if [ `expr $x % $p` != 0 ]; then
echo $x
done | filter

seq 2 100 | filter
Compare to the Go program:… . #golang

Same idea.

Note: This is not the Sieve of Eratosthenes. It's much more expensive. But cool anyway.
Read 3 tweets
i'm finally ready to share my personal story about this whole #golang dependency management process.
Consider it a counterpoint to the story Russ shared last month: . (Please note that he also publicizes private communications in that thread.)
Two weeks ago, i published a screencast that distills the single most essential technical issue (information loss) with the module system that shipped with Go 1.11.

Reasonable fixes should still be possible.
Read 88 tweets
Thrilled by the announcement ( of the portable #golang cloud APIs, but I feel the hard-fought lessons and wins from portability are being forgotten.
It was an immeasurably great improvement when my code would run anywhere, unedited. Unix and C pioneered that (really dmr and scj).
But now there are a million incompatible Unix variants and clones.
Read 10 tweets
Potential client: You have 1 hour to implement this concurrent #golang program in any language you choose.
Me: uhmm ANY language?
PC: well we have to be able to understand it so no BrainF*ck, no obscure Perl, no AWK
Me: Ok what about shell?
PC: you mean bash?
Me: No I mean shell
PC: isnt’ that BASH?
Me: no.. shell is.. *sigh* that’s like asking me if I mean a DeLorean when I say I want a sports car. In this case “sports car” == “shell” and “DeLorean” == “bash”.
PC: ok so what ZSH?
Me: uhmm something like that but different
PC: sure
Me: for the channels stuff can I use named pipes?
PC: what?
Me: fifos?
PC: You mean writing to the file system? No!
Me: <<debates explaining how named pipes actually work and decides to go another route>>
Me: can I do this in Korn Shell?
PC: isn’t that the same thing?
Read 7 tweets
Whenever someone from Java or C++ or C# comes to Go, they look for "class", find "struct", and stop looking. #golang
This misses two fundamental differences between Go and "traditional" OO languages. (But for "traditional" read "recent, mostly C-derived".)
The first is that it's not only structs: Any concrete type can have methods: ints, bools, slices, even funcs:…
Read 6 tweets
For every fave this tweet gets, I will give you one #golang fun fact
Fact #1: according to the go spec, build tools should resolve imports in alphabetical order in order to ensure initialization remains the sa
Fact #2: -128/-1=-128 in #golang, but only sometimes.
Read 51 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!