Skip to content

Bug: pass []any as any in variadic function, Redigo.Do("SET", args)  #3066

Open
@alingse

Description

@alingse

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions