Skip to content

Commit

Permalink
chore: as lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAnotherID committed Jun 20, 2024
1 parent 4d63b4b commit 6c98820
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 2 additions & 0 deletions api/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func checkInstalled(exts []*dice.StoreExt) {
ext.Installed = myDice.InstalledDecks[ext.ID]
case dice.StoreExtTypePlugin:
ext.Installed = myDice.InstalledPlugins[ext.ID]
default:
// pass
}
if len(ext.ID) > 0 {
storeCache[ext.ID] = ext
Expand Down
8 changes: 2 additions & 6 deletions dice/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func (d *Dice) getRecommendFromBackend(backend string) ([]*StoreExt, error) {
if err != nil {
return nil, err
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(resp.Body)
defer resp.Body.Close()

respData, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down Expand Up @@ -162,9 +160,7 @@ func (d *Dice) getStorePageFromBackend(backend string, params StoreQueryPagePara
if err != nil {
return nil, err
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(resp.Body)
defer resp.Body.Close()

respData, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion signature/gen/sign_mods.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func signModFile(root, privateKey string, path, name string, signStrTmpl string)
newData := []byte(fmt.Sprintln(signStrTmpl+sign) + string(data))
target := filepath.Join(dir, name)
if filepath.Ext(target) == ".json" {
target = target + "c" // json 转为 jsonc
target += "c" // json 转为 jsonc
}
err = os.WriteFile(target, newData, 0644)
if err != nil {
Expand Down

0 comments on commit 6c98820

Please sign in to comment.