From c1fc1edb385ed616e2468781280d2f68758fd48d Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 29 Jul 2024 22:53:27 +0100 Subject: [PATCH] 2024-07-29/02: add a quote from Rob Pike --- 2024-07-29/02-go-a-reasonable-good-language.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/2024-07-29/02-go-a-reasonable-good-language.md b/2024-07-29/02-go-a-reasonable-good-language.md index 717d7e2..d99a497 100644 --- a/2024-07-29/02-go-a-reasonable-good-language.md +++ b/2024-07-29/02-go-a-reasonable-good-language.md @@ -74,9 +74,10 @@ func GreaterOrEqual[T cmp.Ordered](t *testing.T, actual, expected T) { Just one of those things that I end up re-writing in every project. Yes, I know about [testify](https://github.com/stretchr/testify) and other assertion -libraries, but nowadays I believe if you can avoid importing a library, as long -the code you write is trivial, it is better to duplicate the code than try to -import a dependency. +libraries, but quoting [Rob +Pike](https://www.youtube.com/watch?v=PAAkCSZUG1c&t=568s) here, "a little +copying is better than a little dependency". As long the code you write is +trivial, it is better to duplicate the code than try to import a dependency. About another piece of code that generics allows me to write and I always end up re-writing in every project is the `must*` family of functions: