Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alingse opened this issue Jul 11, 2022 · 0 comments
Open

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

alingse opened this issue Jul 11, 2022 · 0 comments

Comments

@alingse
Copy link

alingse commented Jul 11, 2022

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))
@alingse alingse changed the title Bug: pass Bug: pass []any as any in variadic function, Redigo.Do("SET", args) Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant