#2479·vuls

修复: 将 go.sum 合并到 Go <1.17 项目的 go.mod 中

作者: kotakanbe创建于 2026年3月19日更新于 2026年3月19日

go for i, scanner := range l.LibraryScanners { if scanner.Type != ftypes.GoModule { continue } if !lessThanGo117(scanner) { continue } dir := filepath.Dir(scanner.LockfilePath) sumContents, ok := goSumContents[dir] if !ok { continue } mergeGoSum(&l.LibraryScanners[i], sumContents) } ```

Note: `models.Library` currently does not have an `Indirect` field. This needs to be added, or the check needs to use the raw `ftypes.Package.Relationship` before conversion to `models.Library`. The simpler approach is to check at the `ftypes.Application` level before `convertLibWithScanner`.

Step 4: Implement mergeGoSum

内容来源: future-architect/vuls