Ver Fonte

x/model: make DisplayComplete DisplayFullest.

Blake Mizerany há 1 ano atrás
pai
commit
0bea2b8916
2 ficheiros alterados com 8 adições e 5 exclusões
  1. 6 3
      x/model/name.go
  2. 2 2
      x/model/name_test.go

+ 6 - 3
x/model/name.go

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

+ 2 - 2
x/model/name_test.go

@@ -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 {
-				t.Errorf("DisplayComplete = %q; want %q", g, tt.wantComplete)
+			if g := p.DisplayFullest(); 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)