---
title: "A proposal for generic slice functions"
publication: "Go Weekly"
issue: 361
published_at: "2021-05-07"
canonical_url: "https://golangweekly.com/issues/361"
---

Plus Go 1.16.4, the benefits of branchless coding, and building view components in pure Go. |        

#​361 — May 7, 2021 

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

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/axe8og2wgst5vcovn8so.jpg)](https://ggcarvalho.dev/posts/montecarlo/)   

[The Art of Solving Problems with Monte Carlo Simulations](https://ggcarvalho.dev/posts/montecarlo/) — This is pretty math-heavy, but it does show several examples of using [Monte Carlo simulations](https://en.wikipedia.org/wiki/Monte_Carlo_method) to converge on a value that could prove useful in this data-driven age. 

Gabriel Carvalho   

[Proposal: A New Package to Provide Generic Slice Functions](https://github.com/golang/go/issues/45955) — Off the back of the eventual arrival of generics comes a proposal for a package containing a lot of the functions you’d expect around comparison and enumeration. 

Ian Lance Taylor et al.   [![\](https://copm.s3.amazonaws.com/5e4f2134.jpg)](https://learn.launchdarkly.com/demo/?utm_source=cooperpress&utm_medium=display&utm_campaign=21q1-cooperpress) 

[Book a Demo. Ship Fast. Rest Easy. LaunchDarkly](https://learn.launchdarkly.com/demo/?utm_source=cooperpress&utm_medium=display&utm_campaign=21q1-cooperpress) — Testing in production? It's scary until it's not. Get total control of your code to ship fast, reduce risk, and reclaim your nights and weekends. 

LaunchDarkly sponsor   

['How Litestream Eliminated My Database Server for $0.03/month'](https://mtlynch.io/litestream/) — [Litestream](https://litestream.io/) replicates data from a local (to your app) SQLite database to an S3-compatible set of SQLite snapshots. In effect, this removes the need for backups and data migrations. Oh, and it runs in its own process. 

Michael Lynch     

Quick Bits 

- [Go 1.16.4 and Go 1.15.12 have been released](https://groups.google.com/g/golang-announce/c/cu9SP4eSXMc/m/vBLImzQOAgAJ) in line with Go's [new security policy.](https://github.com/golang/go/issues/44918) They fix an issue where ReadRequest and ReadResponse in net/http can hit an unrecoverable panic when reading a very large headers.
- **CORRECTION** 👀 Tim Heckman wrote in noting my interpretation of the discussion around [standard Go project layouts](https://github.com/golang-standards/project-layout/issues/117) was incorrect. The Go team does _not_ plan to offer official guidance on this matter – it was merely a third party _suggestion_ to do so. Thanks Tim.  

📘 Tutorials and Stories  

[Branchless Coding in Go](https://mattnakama.com/blog/go-branchless-coding/) — Matt had some bit-packing to do and wondered if he could pull it off without any conditional branching. He gave it a go and reports on the pros and cons of the approach. 

Matt Nakama   

[Between Go and Elixir](https://preslav.me/2021/04/23/between-golang-and-elixir/) — _“Reason wanted me to make a choice, and I am so glad I didn’t. Because the more I kept delving into both Elixir and Go, the more I found out how complementary the two can be to one another.”_ 

Preslav Rachev   

[Provision Infrastructure with Go and Pulumi](https://www.pulumi.com/docs/intro/languages/go/?utm_source=golang-weekly&utm_medium=sponsored-link&utm_campaign=iac) — Use the Go language and ecosystem to manage and provision modern infrastructure across any cloud and a variety of workloads. 

Pulumi sponsor   

[Building a Bingo Game Backend with Encore](https://eaglewas.me/blog/en/bingo-backend-encore) — [Encore](https://github.com/encoredev/encore) does, as promised, provide a lot of ‘magic’ when it comes to getting a service developed and deployed quickly. 

Daniel Aguilera   

▶[Building Tamper-Proof Systems with ImmuDB and Go](https://www.youtube.com/watch?v=01_wEMdOp1U) — [ImmuDB](https://github.com/codenotary/immudb) is an Go-powered database that boasts no data mutation APIs at all and a ‘tamper-evident’ history system. _(16 minutes.)_ 

TutorialEdge   

[A Note on Worker Pools in Go](https://adtac.in/2021/04/23/note-on-worker-pools-in-go.html) — If you’re using goroutines to handle requests then you’ll likely hit memory limits at scale, so worker pools to the rescue. However, there are sharks in those waters, too. 

Adhityaa Chandrasekar   

[How to Model JSON Data in Go with CockroachDB](https://www.cockroachlabs.com/blog/json-go-cockroachdb/) 
Jack Christensen   

[Building a Simple Terminal Emulator in 100 Lines of Go](https://ishuah.com/2021/03/10/build-a-terminal-emulator-in-100-lines-of-go/) 
Ishuah Kariuki    

Jobs  

[Platform Senior Software Engineer [Remote\]](https://grnh.se/caf836d01us) — Doximity is on a mission to transform the US healthcare system. Join us and build the platform our teams use to ship software. 
Doximity   

[Senior Software Engineer (Go) - 100% Remote, UK/EU Only](https://www.form3.tech/careers/job-application?gh_jid=4003519002) — Solving complex technical challenges using the latest, cloud-native technologies to help Banks and FinTechs move money faster. 
Form3    

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/qq3mjh5kviwm7znebqxo.jpg)](https://www.gomponents.com/)  

[Gomponents: View Components in Pure Go](https://www.gomponents.com/) — Write view components in the Go you know and love and they get rendered to HTML. I’ve never been a fan of this approach myself but it’s a neat project all the same. 

Markus Wüstenberg   

[goyek: Create Build Pipelines in Go](https://github.com/goyek/goyek) — This package was heavily influenced by the testing package which is apparent when you run a pipeline. 

goyek   

[Rapidly Identify Golang Bottlenecks with Datadog APM. Try It Free](https://www.datadoghq.com/dg/apm/profiler/go-continuous-profiler/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-GoWeeklyProfilerB) 

Datadog sponsor   

[Twirp 8.0: Simple RPC Framework with Protobuf Service Definitions](https://github.com/twitchtv/twirp) — Define your service in a Protobuf file and this autogenerates Go code with a server interface and fully functional clients. Think gRPC, but without the custom HTTP server and transport implementations - it uses `net/http` instead. [8.0.0](https://github.com/twitchtv/twirp/releases/tag/v8.0.0) brings Twirp up to Protobuf APIV2 standards. 

Twitch   

[sqlc 1.8: Generate Type Safe Go(lang) from SQL](https://github.com/kyleconroy/sqlc) — You write SQL queries, run `sqlc` to generate code and interfaces for those queries, then write Go code that calls the aforementioned code. [1.8.0](https://github.com/kyleconroy/sqlc/releases/tag/v1.8.0) adds support for Postgres 12 and 13 features by upgrading an underlying dependency. 

Kyle Conroy   

- [Ebiten 2.1.0](https://ebiten.org/blog/v2.1.0.html) has been released. No big jumps, but it continues to be a fantastic 2D game library for Go.
- [Fiber 2.9.0](https://github.com/gofiber/fiber) is out – it's an Express.js inspired Web framework so if that was something you like about the Node world, check it out.         

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
