From 713e2feacf8a4c2606588e5a03c77eaa598fe1cf Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Thu, 4 Apr 2024 16:54:46 -0700 Subject: [PATCH] x/model: add MapHash example --- x/model/name_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x/model/name_test.go b/x/model/name_test.go index aba0c5cf..3dcec3f1 100644 --- a/x/model/name_test.go +++ b/x/model/name_test.go @@ -224,3 +224,15 @@ func ExampleMerge() { // Output: // registry.ollama.com/mistral:latest+Q4_0 } + +func ExampleName_MapHash() { + m := map[uint64]bool{} + + m[ParseName("mistral:latest+q4").MapHash()] = true + m[ParseName("miSTRal:latest+Q4").MapHash()] = true + m[ParseName("mistral:LATest+Q4").MapHash()] = true + + fmt.Println(len(m)) + // Output: + // 1 +}