x/model: add DisplayFullest example

This commit is contained in:
Blake Mizerany 2024-04-05 22:50:42 -07:00
parent 0bea2b8916
commit b24f1ad587

View File

@ -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 }