Skip to content

Commit 4084046

Browse files
authored
chore: improve code quality (#171)
1 parent 7b060cd commit 4084046

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

service/appstore.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ func (s *appStore) CategoryMap() (map[string]codegen.CategoryInfo, error) {
6161
}
6262

6363
categoryMap := LoadCategoryMap(storeRoot)
64-
if err != nil {
65-
return nil, err
66-
}
6764

6865
s.categoryMap = categoryMap
6966

service/appstore_management.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (a *AppStoreManagement) DeleteGlobal(key string) error {
9191
func (a *AppStoreManagement) RegisterAppStore(ctx context.Context, appstoreURL string, callbacks ...func(*codegen.AppStoreMetadata)) error {
9292
// check if appstore already exists
9393
for _, url := range config.ServerInfo.AppStoreList {
94-
if strings.ToLower(url) == strings.ToLower(appstoreURL) {
94+
if strings.EqualFold(url, appstoreURL) {
9595
return nil
9696
}
9797
}

service/compose_app.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ func (a *ComposeApp) AuthorType() codegen.StoreAppAuthorType {
9494
return codegen.Unknown
9595
}
9696

97-
if strings.ToLower(storeInfo.Author) == strings.ToLower(storeInfo.Developer) {
97+
if strings.EqualFold(storeInfo.Author, storeInfo.Developer) {
9898
return codegen.Official
9999
}
100-
101-
if strings.ToLower(storeInfo.Author) == strings.ToLower(common.ComposeAppAuthorCasaOSTeam) {
100+
if strings.EqualFold(storeInfo.Author, common.ComposeAppAuthorCasaOSTeam) {
102101
return codegen.ByCasaos
103102
}
104103

0 commit comments

Comments
 (0)