---
title: "Using go run to manage tool dependencies"
publication: "Go Weekly"
issue: 411
published_at: "2022-05-13"
canonical_url: "https://golangweekly.com/issues/411"
---

Plus shrinking Go WebAssembly output by 60%, a new NoSQL database built in Go, and notes on concurrency. |        

🇺🇦 #​411 — May 13, 2022 

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

The _Go Weekly_ Newsletter 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/na9jrselqdhc0uxrmkq0.jpg)](https://segment.com/blog/changing-one-character-improved-app-performance/)  

[Changing One Character Wildly Improved Segment's App Performance](https://segment.com/blog/changing-one-character-improved-app-performance/) — In terms of value per keypress, you can’t beat this, surely. Segment’s engineers noticed some sluggishness in a Go-powered system, used `pprof` to see what was going on, and discovered a tiny change to a sorting comparison function would pay huge dividends. 

Kevin Burke (Segment)   

▶[How to Refactor Cloud Apps in Go 1.18 with Generics](https://www.youtube.com/watch?v=-F2t3oInqKE) — A 20-minute talk from this week’s Google I/O event by two Googlers that introduces Go 1.18’s generics feature, how they differ to other implementations, why to use them, plus a practical demo of refactoring a Go 1.16 app. Easy to follow – a good primer. 

Cameron Balahan and Cody Oss   [![\](https://copm.s3.amazonaws.com/caa6a1a2.png)](https://campaign.dnsimple.page/Go_Cooperpress) 

[Efficient Infrastructure with DNSimple's Terraform Provider](https://campaign.dnsimple.page/Go_Cooperpress) — Use DNSimple’s Terraform provider to manage DNS like with other cloud services, update DNS records & manage DNS infrastructure. Or use the DNSimple Consul integration to automatically provision DNS records from Consul in our authoritative name servers. 

DNSimple sponsor   

[How to Use `go run` to Manage Tool Dependencies](https://www.alexedwards.net/blog/using-go-run-to-manage-tool-dependencies) — Did you know that since Go 1.17 you can use `go run` to run things in remote packages that aren’t even related to your current project/`go.mod`? 

Alex Edwards   

**Quick bits:** 

- Interesting to see the .NET team using Go as a comparison in [their latest .NET 7 Preview benchmarks](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-7-preview-4/) to show how much their gRPC streaming performance has improved.
- [Go 1.18.2 and 1.17.10](https://groups.google.com/g/golang-announce/c/Y5qrqw_lWdU) have been released.     

Jobs  

[Golang Developer at X-Team (Remote)](https://x-team.com/remote-go-developer-jobs/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=cooperpress-go&utm_content=go) — Join the most energizing community for developers and work on long-term projects for Riot Games, FOX, Sony, Coinbase, and more. 
X-Team   

[Golang Engineers — 100% Remote (North/South America & Europe)](https://www.ardanlabs.com/careers/mid-level-and-senior-backend-engineer.html) — We’ve got several opportunities for Go devs (some working directly with Bill Kennedy!) and would love to hear from those looking for new challenges in distributed systems projects. 
Ardan Labs   

[Backend Engineer | Remote Within CET (-3/+3 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   

[Find a Job Through 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      

[Of Ducks and Go Interface Misuse](https://8thlight.com/blog/go-interface-misuse/) — It’s easy to create interfaces when reuse needs arise, but it’s also easy to create bad interfaces that make things harder for developers to use later. 

Bart Bucknill (8th Light)   

[Shrink Your TinyGo WebAssembly Modules by 60%](https://www.fermyon.com/blog/optimizing-tinygo-wasm) — Every byte matters when you’re sending it down the wire to be run in a browser, so going from 1.1MB to 377KB in this case with the _same_ source file was a big win. 

Matt Butcher   

[testscript: Define Filesystem-Based Tests by Creating Scripts](https://encore.dev/blog/testscript-hidden-testing-gem) — Originally created for testing the Go compiler itself, `testscript` makes filesystem-based testing simple with just a few Unix-like commands and intuitive utilities to check test success. This post shows it off. 

André Eriksson   

[Go's Concurrency Examples in Java 19](https://mccue.dev/pages/5-2-22-go-concurrency-in-java) — Java is about to get support for ‘virtual threads’ which are vaguely similar to goroutines, and the author of this article wanted to compare some Go examples with what the equivalent Java will be. Go certainly wins when it comes to tighter, more readable code! 

Ethan McCue   

[SSRF Attack Examples and Mitigations](https://goteleport.com/blog/ssrf-attacks/?utm_campaign=eg&utm_medium=partner&utm_source=golangweekly) 

Teleport sponsor   

[Notes on Practical Concurrency in Go](https://github.com/luk4z7/go-concurrency-guide) — Not exactly a tutorial but a set of notes around a variety of concurrent related mechanisms in Go including mutexes, channels, patterns for distributing tasks, etc. 

Lucas Alves   

▶[What to Do When Projects Get Big and Messy](https://changelog.com/gotime/229) — The _Go Time_ podcast tackles the topic of software maintenance again. _(66-minutes.)_ 

Go Time Podcast podcast   

[Panic Recovery in Go](https://tutorialedge.net/golang/go-panic-recovery-tutorial/) — Don’t defer reading this article. (_I’ll see myself out._) 

Elliot Forbes   

[How to Pixelate Images in Go](https://golangprojectstructure.com/how-to-pixelate-images-in-go-code/) 
Anon  

🛠 Code & Tools  

[cast: Safe and Easy Casting From One Type to Another](https://github.com/spf13/cast) — It’s as easy as using `ToString`, `ToInt`, `ToTime` and more. 

Steve Francia   

[RoseDB 1.0: A High Performance NoSQL Database Based on Bitcask](https://github.com/flower-corp/rosedb) — Always interesting to see another attempt at building a database in Go. This one is inspired by a popular Erlang-based key/value store, Bitcask, has a Redis-like feel, and can be used standalone or even embedded into a Go app. 

FlowerCorp   

[Fx 24.0: A Command-Line JSON Processing Tool](https://github.com/antonmedv/fx) — If you’ve got some files full of JSON that you want to process, Fx will slice and dice it however you want. It was recently rewritten in Go from its original JavaScript and now supports writing reducers in JavaScript, Python or Ruby. 

Anton Medvedev   

[FerretDB 0.2: An In-Progress, Go-Powered MongoDB Alternative](https://github.com/FerretDB/FerretDB) — MongoDB, you say? Yes. This is an attempt to recreate the _essentials_ of MongoDB in Go so it could work as a drop-in replacement and it uses Postgres as the underlying database engine. 

FerretDB   

[rqlite 7.4.0: A Distributed Relational Database Built on SQLite](https://github.com/rqlite/rqlite) — [7.4.0](https://github.com/rqlite/rqlite/releases/tag/v7.4.0) adds support for restoring a node from an actual SQLite file rather than an SQL dump. 

rqlite   

[sh 3.5: A Shell Code Parser, Formatter, and Interpreter](https://github.com/mvdan/sh) — Supporting sh, bash, and Korn formats. 

Daniel Martí   

[OctoSQL: Join, Analyze, and Transform Data From Multiple Sources using SQL](https://github.com/cube2222/octosql) — Supported sources are CSV, JSON, MySQL, PostgreSQL, Redis and, as of this week, Parquet. 

Jacob Martin   

[Weron: Create Overlay Networks Based on WebRTC](https://github.com/pojntfx/weron) 
Felicitas Pojtinger         

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
