projectdiscovery/nuclei · error
keys must be []string or []interface{}, got %T
Error message
keys must be []string or []interface{}, got %T What it means
Error "keys must be []string or []interface{}, got %T" thrown in projectdiscovery/nuclei.
Source
Thrown at pkg/js/libs/redis/redis.go:224
keysSlice := []string{}
if keys != nil {
switch v := keys.(type) {
case []string:
keysSlice = v
case []interface{}:
keysSlice = make([]string, 0, len(v))
for _, item := range v {
keysSlice = append(keysSlice, fmt.Sprintf("%v", item))
}
case string:
// the goja runtime zero-fills omitted trailing JS arguments with
// the previous parameter's type, so a 4-arg call (old signature)
// delivers "" here: treat it as no keys (backwards compat)
if v != "" {
return nil, fmt.Errorf("keys must be []string or []interface{}, got string")
}
default:
return nil, fmt.Errorf("keys must be []string or []interface{}, got %T", keys)
}
}
// Convert interface{} args to []interface{} for Eval (handle backwards
// compatibility). Non-string items (numbers, booleans from JavaScript)
// are stringified rather than dropped: Redis ARGV values are always
// bulk strings on the Lua side, so "123"/"true" match JS expectations.
argsInterface := []interface{}{}
if args != nil {
switch v := args.(type) {
case []string:
argsInterface = make([]interface{}, len(v))
for i, arg := range v {
argsInterface[i] = arg
}
case []interface{}:
argsInterface = make([]interface{}, len(v))
for i, item := range v {View on GitHub (pinned to 265b3a3dec)
When it happens
Trigger: Thrown at pkg/js/libs/redis/redis.go:224 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/92fa7893abb7d937.
Report an issue: GitHub.