Selaa lähdekoodia

fix: accumulate word count function plugin (#2170)

Signed-off-by: Kobi Levi <kobilevi503@gmail.com>
Kobi Levi 1 vuosi sitten
vanhempi
commit
c4c9b4ab89

+ 1 - 1
extensions/functions/accumulateWordCount/accumulateWordCount.go

@@ -56,7 +56,7 @@ func (f *accumulateWordCountFunc) Exec(args []interface{}, ctx api.FunctionConte
 	sep, ok := args[1].(string)
 	sep, ok := args[1].(string)
 	if !ok {
 	if !ok {
 		logger.Debugf("Exec accumulateWordCountFunc with arg1 %s", sep)
 		logger.Debugf("Exec accumulateWordCountFunc with arg1 %s", sep)
-		return fmt.Errorf("args[1] is not a string, got %v", args[0]), false
+		return fmt.Errorf("args[1] is not a string, got %v", args[1]), false
 	}
 	}
 
 
 	err := ctx.IncrCounter("allwordcount", len(strings.Split(col, sep)))
 	err := ctx.IncrCounter("allwordcount", len(strings.Split(col, sep)))