x/model: make DisplayComplete DisplayFullest.
This commit is contained in:
parent
e4d65d5aef
commit
0bea2b8916
@ -191,7 +191,10 @@ func (r Name) DisplayModel() string {
|
|||||||
return r.model
|
return r.model
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r Name) DisplayComplete() string {
|
// DisplayFullest returns the most specific display string of the Name.
|
||||||
|
//
|
||||||
|
// It does not include the build.
|
||||||
|
func (r Name) DisplayFullest() string {
|
||||||
return (Name{
|
return (Name{
|
||||||
host: r.host,
|
host: r.host,
|
||||||
namespace: r.namespace,
|
namespace: r.namespace,
|
||||||
@ -219,7 +222,7 @@ func (r Name) LogValue() slog.Value {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DisplayShort returns a short display string of the Name with only the
|
// DisplayShort returns a short display string of the Name with only the
|
||||||
// model, tag, and build parts.
|
// model, tag.
|
||||||
//
|
//
|
||||||
// It does not include the build.
|
// It does not include the build.
|
||||||
func (r Name) DisplayShort() string {
|
func (r Name) DisplayShort() string {
|
||||||
@ -230,7 +233,7 @@ func (r Name) DisplayShort() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DisplayLong returns a long display string of the Name including namespace,
|
// DisplayLong returns a long display string of the Name including namespace,
|
||||||
// model, tag, and build parts.
|
// model, tag.
|
||||||
//
|
//
|
||||||
// It does not include the build.
|
// It does not include the build.
|
||||||
func (r Name) DisplayLong() string {
|
func (r Name) DisplayLong() string {
|
||||||
|
@ -254,8 +254,8 @@ func TestNameDisplay(t *testing.T) {
|
|||||||
if g := p.DisplayLong(); g != tt.wantLong {
|
if g := p.DisplayLong(); g != tt.wantLong {
|
||||||
t.Errorf("DisplayLong = %q; want %q", g, tt.wantLong)
|
t.Errorf("DisplayLong = %q; want %q", g, tt.wantLong)
|
||||||
}
|
}
|
||||||
if g := p.DisplayComplete(); g != tt.wantComplete {
|
if g := p.DisplayFullest(); g != tt.wantComplete {
|
||||||
t.Errorf("DisplayComplete = %q; want %q", g, tt.wantComplete)
|
t.Errorf("DisplayFullest = %q; want %q", g, tt.wantComplete)
|
||||||
}
|
}
|
||||||
if g := p.String(); g != tt.in {
|
if g := p.String(); g != tt.in {
|
||||||
t.Errorf("String(%q) = %q; want %q", tt.in, g, tt.in)
|
t.Errorf("String(%q) = %q; want %q", tt.in, g, tt.in)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user