[#58] Update receivers for golint
This patch addresses golint failures such as: pkg/config/repo.go:35:1: receiver name r should be consistent with previous receiver name c for RepoCheckout pkg/config/repo.go:76:1: receiver name r should be consistent with previous receiver name auth for RepoAuth pkg/config/repo.go:127:1: receiver name r should be consistent with previous receiver name repo for Repository pkg/config/repo.go:135:1: receiver name spec should be consistent with previous receiver name repo for Repository Relates-To: #58 Change-Id: I5f7eec779ee6438cb290a9f82febef74a7ea8123 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This commit is contained in:
parent
1d87b87ede
commit
07159cc7f4
@ -32,8 +32,8 @@ func (c *RepoCheckout) Equal(s *RepoCheckout) bool {
|
||||
c.RemoteRef == s.RemoteRef
|
||||
}
|
||||
|
||||
func (r *RepoCheckout) String() string {
|
||||
yaml, err := yaml.Marshal(&r)
|
||||
func (c *RepoCheckout) String() string {
|
||||
yaml, err := yaml.Marshal(&c)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
@ -73,8 +73,8 @@ func (auth *RepoAuth) Equal(s *RepoAuth) bool {
|
||||
auth.Username == s.Username
|
||||
}
|
||||
|
||||
func (r *RepoAuth) String() string {
|
||||
yaml, err := yaml.Marshal(&r)
|
||||
func (auth *RepoAuth) String() string {
|
||||
yaml, err := yaml.Marshal(&auth)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
@ -124,28 +124,28 @@ func (repo *Repository) Equal(s *Repository) bool {
|
||||
reflect.DeepEqual(s.CheckoutOptions, repo.CheckoutOptions)
|
||||
}
|
||||
|
||||
func (r *Repository) String() string {
|
||||
yaml, err := yaml.Marshal(&r)
|
||||
func (repo *Repository) String() string {
|
||||
yaml, err := yaml.Marshal(&repo)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(yaml)
|
||||
}
|
||||
|
||||
func (spec *Repository) Validate() error {
|
||||
if spec.URLString == "" {
|
||||
func (repo *Repository) Validate() error {
|
||||
if repo.URLString == "" {
|
||||
return ErrRepoSpecRequiresURL{}
|
||||
}
|
||||
|
||||
if spec.Auth != nil {
|
||||
err := spec.Auth.Validate()
|
||||
if repo.Auth != nil {
|
||||
err := repo.Auth.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if spec.CheckoutOptions != nil {
|
||||
err := spec.CheckoutOptions.Validate()
|
||||
if repo.CheckoutOptions != nil {
|
||||
err := repo.CheckoutOptions.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user