Skip to content

Commit

Permalink
Obsidian Sync 2025-01-16 16:45:18
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakjois committed Jan 16, 2025
1 parent 38002dd commit 9bf7b8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/daily-notes/2025-01-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ YouTube Music Playlist: [The Amplifier: Readers Pick the Songs That Defined Thei
> - the list of books you’ve finished
#### Interesting Go testing technique
[if got, want: A Simple Way to Write Better Go Tests ·mtlynch.io](https://mtlynch.io/if-got-want-improve-go-tests/) #golang #testing

> There’s an excellent Go testing pattern that too few people know. I can teach it to you in 30 seconds.
>
Expand All @@ -59,4 +60,4 @@ if got, want := GetUser(), "dummyUser"; got != want {
}
```

The `if got, want :=`: pattern works even better in [table-driven tests](https://go.dev/wiki/TableDrivenTests). Here’s an example from [my library for parsing social media handles](https://github.com/mtlynch/social-go/blob/5348ed8e66e318651c646aea4d72ef62481c30fa/twitter_test.go):
> The `if got, want :=`: pattern works even better in [table-driven tests](https://go.dev/wiki/TableDrivenTests). Here’s an example from [my library for parsing social media handles](https://github.com/mtlynch/social-go/blob/5348ed8e66e318651c646aea4d72ef62481c30fa/twitter_test.go):

0 comments on commit 9bf7b8a

Please sign in to comment.