Skip to content

Commit 734f49c

Browse files
committed
fix: Don't use built in String method
1 parent 83d728c commit 734f49c

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

specs/destination.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (d *Destination) Validate() error {
7272
return nil
7373
}
7474

75-
func (d Destination) String() string {
75+
func (d Destination) VersionString() string {
7676
if d.Registry != RegistryGithub {
7777
return fmt.Sprintf("%s (%s@%s)", d.Name, d.Registry, d.Path)
7878
}

specs/destination_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func TestDestinationUnmarshalSpecValidate(t *testing.T) {
198198
}
199199
}
200200

201-
func TestDestination_String(t *testing.T) {
201+
func TestDestination_VersionString(t *testing.T) {
202202
type fields struct {
203203
Name string
204204
Version string
@@ -259,7 +259,7 @@ func TestDestination_String(t *testing.T) {
259259
Path: tt.fields.Path,
260260
Registry: tt.fields.Registry,
261261
}
262-
if got := d.String(); got != tt.want {
262+
if got := d.VersionString(); got != tt.want {
263263
t.Errorf("Destination.String() = %v, want %v", got, tt.want)
264264
}
265265
})

specs/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (s *Source) Validate() error {
129129
return nil
130130
}
131131

132-
func (s Source) String() string {
132+
func (s Source) VersionString() string {
133133
if s.Registry != RegistryGithub {
134134
return fmt.Sprintf("%s (%s@%s)", s.Name, s.Registry, s.Path)
135135
}

specs/source_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func TestSourceUnmarshalSpecValidate(t *testing.T) {
190190
}
191191
}
192192

193-
func TestSpec_String(t *testing.T) {
193+
func TestSpec_VersionString(t *testing.T) {
194194
type fields struct {
195195
Name string
196196
Version string
@@ -251,7 +251,7 @@ func TestSpec_String(t *testing.T) {
251251
Path: tt.fields.Path,
252252
Registry: tt.fields.Registry,
253253
}
254-
if got := s.String(); got != tt.want {
254+
if got := s.VersionString(); got != tt.want {
255255
t.Errorf("Source.String() = %v, want %v", got, tt.want)
256256
}
257257
})

0 commit comments

Comments
 (0)