Skip to content

Commit a32e393

Browse files
authored
Merge pull request #15 from utilitywarehouse/as-changed-files
follow golang guide
2 parents fad4cce + ade79f0 commit a32e393

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkg/mirror/repo_pool.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (rp *RepoPool) Subject(ctx context.Context, remote, hash string) (string, e
164164
return repo.Subject(ctx, hash)
165165
}
166166

167-
// ChangedFiles is wrapper around repositories Subject ChangedFiles
167+
// ChangedFiles is wrapper around repositories ChangedFiles method
168168
func (rp *RepoPool) ChangedFiles(ctx context.Context, remote, hash string) ([]string, error) {
169169
repo, err := rp.Repository(remote)
170170
if err != nil {
@@ -173,13 +173,13 @@ func (rp *RepoPool) ChangedFiles(ctx context.Context, remote, hash string) ([]st
173173
return repo.ChangedFiles(ctx, hash)
174174
}
175175

176-
// IsObjectExists is wrapper around repositories Subject IsObjectExists
177-
func (rp *RepoPool) IsObjectExists(ctx context.Context, remote, obj string) error {
176+
// ObjectExists is wrapper around repositories ObjectExists method
177+
func (rp *RepoPool) ObjectExists(ctx context.Context, remote, obj string) error {
178178
repo, err := rp.Repository(remote)
179179
if err != nil {
180180
return err
181181
}
182-
return repo.IsObjectExists(ctx, obj)
182+
return repo.ObjectExists(ctx, obj)
183183
}
184184

185185
// Clone is wrapper around repositories Clone method

pkg/mirror/repository.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (r *Repository) Subject(ctx context.Context, hash string) (string, error) {
189189
r.lock.RLock()
190190
defer r.lock.RUnlock()
191191

192-
if err := r.IsObjectExists(ctx, hash); err != nil {
192+
if err := r.ObjectExists(ctx, hash); err != nil {
193193
return "", err
194194
}
195195

@@ -206,7 +206,7 @@ func (r *Repository) ChangedFiles(ctx context.Context, hash string) ([]string, e
206206
r.lock.RLock()
207207
defer r.lock.RUnlock()
208208

209-
if err := r.IsObjectExists(ctx, hash); err != nil {
209+
if err := r.ObjectExists(ctx, hash); err != nil {
210210
return nil, err
211211
}
212212

@@ -218,8 +218,8 @@ func (r *Repository) ChangedFiles(ctx context.Context, hash string) ([]string, e
218218
return strings.Split(msg, "\n"), nil
219219
}
220220

221-
// IsObjectExists returns error is given object is not valid or if it doesn't exists
222-
func (r *Repository) IsObjectExists(ctx context.Context, obj string) error {
221+
// ObjectExists returns error is given object is not valid or if it doesn't exists
222+
func (r *Repository) ObjectExists(ctx context.Context, obj string) error {
223223
r.lock.RLock()
224224
defer r.lock.RUnlock()
225225

0 commit comments

Comments
 (0)