reva
reva copied to clipboard
Bug: pass []any as any in variadic function, Redigo.Do("SET", args)
i am writing a linter to lint that pass []any as any in variadic function
and run github Actions for some top go packages, this package failed
see github action result here https://github.com/alingse/asasalint/runs/7271246945?check_suite_focus=true
Error: /home/runner/work/asasalint/asasalint/reva/pkg/share/cache/redis/redis.go:124:31: pass []any as any to func Do func(commandName string, args ...interface{}) (reply interface{}, err error)
the redis usage
args := []interface{}{key, encodedInfo}
if expiration != -1 {
args = append(args, "EX", expiration)
}
if _, err := conn.Do("SET", args); err != nil {
return err
}
return nil
should be
conn.Do("SET", args...)
and this might be a bug too?
vals, err := redis.Strings(conn.Do("MGET", keys))