From b24f1ad5879515e291f2597da6761ba1b254e8bd Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Fri, 5 Apr 2024 22:50:42 -0700 Subject: [PATCH] x/model: add DisplayFullest example --- x/model/name_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/x/model/name_test.go b/x/model/name_test.go index 54f44ce8..8c0da86e 100644 --- a/x/model/name_test.go +++ b/x/model/name_test.go @@ -396,4 +396,19 @@ func ExampleName_CompareFold_sort() { // mistral:latest } +func ExampleName_DisplayFullest() { + for _, s := range []string{ + "example.com/jmorganca/mistral:latest+Q4_0", + "mistral:latest+Q4_0", + "mistral:latest", + } { + fmt.Println(ParseName(s).DisplayFullest()) + } + + // Output: + // example.com/jmorganca/mistral:latest + // mistral:latest + // mistral:latest +} + func keep[T any](v T) T { return v }