Remove Stringer from ghrepo.Interface (#5536)

This commit is contained in:
Heath Stewart 2022-04-27 23:58:34 -07:00 committed by GitHub
parent beba0e1d78
commit 5ed83e2b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 17 deletions

View file

@ -215,11 +215,6 @@ func (r Repository) RepoHost() string {
return r.hostname
}
// String returns the OWNER/NAME of the repository
func (r Repository) String() string {
return fmt.Sprintf("%s/%s", r.Owner.Login, r.Name)
}
// ViewerCanPush is true when the requesting user has push access
func (r Repository) ViewerCanPush() bool {
switch r.ViewerPermission {

View file

@ -11,7 +11,6 @@ import (
// Interface describes an object that represents a GitHub repository
type Interface interface {
fmt.Stringer
RepoName() string
RepoOwner() string
RepoHost() string
@ -145,7 +144,3 @@ func (r ghRepo) RepoName() string {
func (r ghRepo) RepoHost() string {
return r.hostname
}
func (r ghRepo) String() string {
return fmt.Sprintf("%s/%s", r.owner, r.name)
}

View file

@ -217,11 +217,6 @@ func TestFromFullName(t *testing.T) {
if r.RepoName() != tt.wantName {
t.Errorf("expected name %q, got %q", tt.wantName, r.RepoName())
}
wantString := fmt.Sprintf("%s/%s", tt.wantOwner, tt.wantName)
if r.String() != wantString {
t.Errorf("String() expected %q, got %q", wantString, r.String())
}
})
}
}

View file

@ -96,9 +96,9 @@ func cloneRun(opts *cloneOptions) error {
switch {
case successCount == totalCount:
fmt.Fprintf(opts.IO.Out, "%s Cloned %s from %s to %s\n", cs.SuccessIcon(), pluralize(successCount), opts.SourceRepo, ghrepo.FullName(baseRepo))
fmt.Fprintf(opts.IO.Out, "%s Cloned %s from %s to %s\n", cs.SuccessIcon(), pluralize(successCount), ghrepo.FullName(opts.SourceRepo), ghrepo.FullName(baseRepo))
default:
fmt.Fprintf(opts.IO.Out, "%s Cloned %s of %d from %s to %s\n", cs.WarningIcon(), pluralize(successCount), totalCount, opts.SourceRepo, ghrepo.FullName(baseRepo))
fmt.Fprintf(opts.IO.Out, "%s Cloned %s of %d from %s to %s\n", cs.WarningIcon(), pluralize(successCount), totalCount, ghrepo.FullName(opts.SourceRepo), ghrepo.FullName(baseRepo))
}
}