fix(discord): satisfy wiretap lint

This commit is contained in:
Vincent Koc 2026-04-24 00:42:30 -07:00
parent afd9b5b33e
commit a473225867
No known key found for this signature in database

View File

@ -122,7 +122,7 @@ func scan(ctx context.Context, opts Options) (Stats, snapshot, error) {
}
if err := filepath.WalkDir(root, func(path string, entry fs.DirEntry, err error) error {
if err != nil {
return nil
return ignoreCacheFileError(err)
}
if ctx.Err() != nil {
return ctx.Err()
@ -136,7 +136,7 @@ func scan(ctx context.Context, opts Options) (Stats, snapshot, error) {
info, err := entry.Info()
if err != nil {
stats.FilesSkipped++
return nil
return ignoreCacheFileError(err)
}
if !isCandidateFile(path) || info.Size() <= 0 || info.Size() > maxBytes {
stats.FilesSkipped++
@ -145,7 +145,7 @@ func scan(ctx context.Context, opts Options) (Stats, snapshot, error) {
data, err := os.ReadFile(path)
if err != nil {
stats.FilesSkipped++
return nil
return ignoreCacheFileError(err)
}
stats.FilesScanned++
stats.BytesScanned += int64(len(data))
@ -215,6 +215,10 @@ func scan(ctx context.Context, opts Options) (Stats, snapshot, error) {
return stats, snap, nil
}
func ignoreCacheFileError(error) error {
return nil
}
func writeSnapshot(ctx context.Context, st *store.Store, snap snapshot) error {
if err := st.DeleteGuildData(ctx, "@unknown"); err != nil {
return err