Skip to content

Commit da313ff

Browse files
committed
fix lint
1 parent 1043d39 commit da313ff

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

services/convert/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR
243243
RepoTransfer: transfer,
244244
Topics: repo.Topics,
245245
ObjectFormatName: repo.ObjectFormatName,
246-
Licenses: repoLicenses.StringList(),
246+
Licenses: repoLicenses.StringList(),
247247
}
248248
}
249249

services/repository/license.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func UpdateRepoLicenses(ctx context.Context, repo *repo_model.Repository, commit
161161
return nil
162162
}
163163

164-
_, licenseFile, err := findLicenseFile(commit)
164+
licenseFile, err := findLicenseFile(commit)
165165
if err != nil {
166166
return fmt.Errorf("findLicenseFile: %w", err)
167167
}
@@ -187,7 +187,7 @@ func GetDetectedLicenseFileName(ctx context.Context, repo *repo_model.Repository
187187
if commit == nil {
188188
return "", nil
189189
}
190-
_, licenseFile, err := findLicenseFile(commit)
190+
licenseFile, err := findLicenseFile(commit)
191191
if err != nil {
192192
return "", fmt.Errorf("findLicenseFile: %w", err)
193193
}
@@ -198,15 +198,16 @@ func GetDetectedLicenseFileName(ctx context.Context, repo *repo_model.Repository
198198
}
199199

200200
// findLicenseFile returns the entry of license file in the repository if it exists
201-
func findLicenseFile(commit *git.Commit) (string, *git.TreeEntry, error) {
201+
func findLicenseFile(commit *git.Commit) (*git.TreeEntry, error) {
202202
if commit == nil {
203-
return "", nil, nil
203+
return nil, nil
204204
}
205205
entries, err := commit.ListEntries()
206206
if err != nil {
207-
return "", nil, fmt.Errorf("ListEntries: %w", err)
207+
return nil, fmt.Errorf("ListEntries: %w", err)
208208
}
209-
return FindFileInEntries(util.FileTypeLicense, entries, "", "", false)
209+
_, f, err := FindFileInEntries(util.FileTypeLicense, entries, "", "", false)
210+
return f, err
210211
}
211212

212213
// detectLicense returns the licenses detected by the given content buff

0 commit comments

Comments
 (0)