---
title: "How Go calculates len()"
publication: "Go Weekly"
issue: 374
published_at: "2021-08-06"
canonical_url: "https://golangweekly.com/issues/374"
---

Plus unpopular unpopular opinions, creating a Discord bot in Go, and some handy command line tools. |        

#​374 — August 6, 2021 

[Unsubscribe](https://golangweekly.com/leave/*|UID|*)|[Read on the Web](https://golangweekly.com/issues/374)   

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/h1yng2hpa1b4rjod4zz0.jpg)](https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted)   

[Go 10th Most Loved Language in Stack Overflow Survey](https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted) — Over 80,000 developers took Stack Overflow’s popular annual survey this year, and Go has done pretty well with 9.55% of respondents using it and 63% of developers with an opinion on Go ‘loving’ it. [Full survey results here](https://insights.stackoverflow.com/survey/2021). 

Stack Overflow   

[How Does Go Calculate `len()`?](https://tpaschalis.github.io/golang-len/) — A walk through the compiler showing that `len()` is not an actual function call so it has to be handled differently for each type that has a length. This is great for those wanting to dig into the compiler a bit more. 

Paschalis Tsilias   [![\](https://copm.s3.amazonaws.com/218797b7.png)](https://get.mux.com/3fsBc1d) 

[Live Streaming for Go Apps](https://get.mux.com/3fsBc1d) — From zero to live streaming in a couple of minutes. Mux Video is an API-first platform that makes it easy to build beautiful live video that streams everywhere. 

Mux sponsor   

[Go 1.16.7 and 1.15.15 Released](https://groups.google.com/g/golang-announce/c/uHACNfXAZqk/m/46sU9AeUAAAJ) — Minor point releases to fix a security issue in net/http/httputil’s ReverseProxy. [Go 1.17 RC2](https://groups.google.com/g/golang-announce/c/yk30ovJGXWY/m/p9uUnKbbBQAJ) has also been released if you want to continue testing. 

Alex Rakoczy   

▶[Opening Up the _Go Time_ Opinion Box](https://changelog.com/gotime/191) — This is a fun _Go Time_ episode reviewing the _most_ and _least_ popular “unpopular opinions” shared on the show over the years. It’s fun because it reflects on previous guests and covers a lot of possibly contentious ground quickly. 

Go Time Podcast podcast   

[Build a Highly Available Kubernetes Operator with Go](https://t.co/clDEqGwfnE?amp=1) — Martín goes through all the components (Controller, Worker, CRD, etc.) and covers running the operator in a high availability environment. 

Martín Montes   

[Fixing Common Problems with CORS and JavaScript (on a Go REST API)](https://developer.okta.com/blog/2021/08/02/fix-common-problems-cors) — The author uses a simple Go-based REST API to demonstrate the concepts and resolves the problems brought up in JavaScript-to-backend communications by tweaking HTTP headers appropriately. 

Phillip Edwards   

[Getting Started with Libsodium in Python and Go](https://developer.okta.com/blog/2021/08/05/libsodium-encryption-go-python) — [libsodium](https://github.com/jedisct1/libsodium) is a fork of the [NaCl](http://nacl.cr.yp.to/) cryptography library. 

Phillip Edwards     

Jobs  

[Backend Engineer (Go) | Remote Within CET (-2/+2 Hours) | Full-Time](https://jobs.lever.co/qonto/284b8162-5293-4ad7-a9e6-4ad26ce0c516?lever-origin=applied&lever-source%5B%5D=Cooperpress) — Join us as a Backend Engineer to create the finance solution all businesses love - Tailor made remote policy or relocation package. 
Qonto   

[Enjoy Building Scalable Infrastructure in Go? Stream Is Hiring](https://angel.co/company/stream/jobs/241159-backend-software-engineer-go) — Like coding in Go? We do too. Stream is hiring in Amsterdam. [Apply now](https://angel.co/company/stream/jobs/241159-backend-software-engineer-go%20). 
Stream   

[Find Tech Jobs with Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-golangweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired     

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/juowkkgedo1koahvzpnq.jpg)](https://earthly.dev/blog/command-line-tools/)  

[Six Command Line Tools for Productive Programmers](https://earthly.dev/blog/command-line-tools/) — Some truly helpful items here. The [FZF](https://github.com/junegunn/fzf) fuzzy file finder (written in Go) is particularly handy. 

Adam Gordon Bell   

[Ent 0.9.0 Released with New Upsert API](https://entgo.io/blog/2021/08/05/announcing-upsert-api/) — [Ent](https://entgo.io/) is a Go entity framework for modelling schemas and querying data - it now natively supports ‘upsert’ behavior (essentially an atomic ‘update or insert’ operation). 

Rotem Tamir   

[gosec: A Go Code Security Checker](https://github.com/securego/gosec) — Runs a series of rules over some Go code’s abstract syntax tree to spot potential issues. 

Secure Go   

[Track Requests to Your Golang Apps End-To-End with Datadog APM](https://www.datadoghq.com/dg/apm/golang-app-health/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-GoWeeklyHealthB) 

Datadog APM sponsor   

[Virgo: A Graph-Based Configuration Language](https://matt-rickard.com/virgo-lang/) — Virgo parses and models directed acyclic graphs using its own configuration language so you can build dependency graphs, build pipelines, or any number of things. 

Matt Rickard   

[otpgen: Library to Generate TOTP/HOTP Codes](https://github.com/grijul/otpgen) — You know those codes that apps like Google Authenticator or Authy generate to let you log into some sites? Those. 

Rijul Gulati   

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/zj8d7yvxj7ctjnqbwhq6.jpg)](https://github.com/muesli/termenv)  

[termenv: Advanced ANSI Style and Color Support for Terminal Apps](https://github.com/muesli/termenv) — Offers convenient methods to colorize and style output, without needing to deal with weird ANSI escape sequences and color conversions. 

Christian Muehlhaeuser   

[cxgo: Another Tool for Transpiling C to Go](https://github.com/gotranspile/cxgo) — [c2go](https://github.com/elliotchance/c2go) is the established player in this space. 

Go Transpile   

[cloudflare-go: A Go Library for the Cloudflare V4 API](https://github.com/cloudflare/cloudflare-go) 
Cloudflare         

Curated by [Glenn Goodrich](https://twitter.com/ruprict) and [Peter Cooper](https://twitter.com/peterc). 

[Change your email address](https://golangweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://golangweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
