Skip to content

Commit

Permalink
Fix lastUpdated due to copy of slice
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan committed Oct 25, 2024
1 parent fa47a7d commit d4d8711
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metascoop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,15 @@ func main() {
}
}
for _, pkgs := range fdroidIndex.Packages {
for _, pkg := range pkgs {
repoApp, ok := apkInfoMap[pkg.ApkName]
for i := range pkgs {
repoApp, ok := apkInfoMap[pkgs[i].ApkName]
if ok && strings.TrimSpace(repoApp.LastUpdated) != "" {
t, err := time.Parse(time.RFC3339, repoApp.LastUpdated)
if err != nil {
log.Printf("Error parsing time: %v", err)
continue
}
pkg.Added = int64(t.UnixMilli())
pkgs[i].Added = int64(t.UnixMilli()) // 通过索引修改原始值
}
}
}
Expand Down

0 comments on commit d4d8711

Please sign in to comment.