diff options
| author | a73x <[email protected]> | 2024-09-04 09:30:23 +0100 |
|---|---|---|
| committer | a73x <[email protected]> | 2024-09-04 09:30:23 +0100 |
| commit | 3d6d3fe9344c588dba734ee155b5f08b87840e43 (patch) | |
| tree | 03a91111552576164f38d3cbc81977bed4b32c50 /content/posts/005.md | |
| parent | cdc0dec8a66d94463a3968a72b90bb4e2ec1c170 (diff) | |
feat(html): add toc + footnotes
Diffstat (limited to 'content/posts/005.md')
| -rw-r--r-- | content/posts/005.md | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/content/posts/005.md b/content/posts/005.md index 55aa9ea..9f37c70 100644 --- a/content/posts/005.md +++ b/content/posts/005.md @@ -4,7 +4,8 @@ tags: posts --- https://pkg.go.dev/unique ->The unique package provides facilities for canonicalising ("interning") comparable values. [[1](https://pkg.go.dev/unique)] +>The unique package provides facilities for canonicalising ("interning") comparable values.[^1] +[^1]: https://pkg.go.dev/unique oh yeah, thats obvious I fully understand what this package does now, great read, tune in for the next post. @@ -31,10 +32,7 @@ With a small demo here https://go.dev/play/p/piSYjCHIcLr This implementation is fairly naive, it can only grow and it only works with strings, so naturally go's implementation is a better. It's also worth noting, that since strings are a pointer under the hood ->When comparing two strings, if the pointers are not equal, then we must compare their contents to determine equality. But if we know that two strings are canonicalized, then it _is_ sufficient to just check their pointers. [[2](https://go.dev/blog/unique)] +>When comparing two strings, if the pointers are not equal, then we must compare their contents to determine equality. But if we know that two strings are canonicalized, then it _is_ sufficient to just check their pointers.[^2] +[^2]: https://go.dev/blog/unique So to recap, goes `unique` package provides a way to reuse objects instead of creating new ones, if we consider the objects of equal value. - -## References -1. https://pkg.go.dev/unique -2. https://go.dev/blog/unique
\ No newline at end of file |
