Skip to content

Commit

Permalink
fixup! js/k6/exec: Allow to set state's Tags
Browse files Browse the repository at this point in the history
Reduced kinds' types and improved the warning message

Co-authored-by: na-- <n@andreev.sh>
  • Loading branch information
codebien and na-- authored Nov 3, 2021
1 parent aaf5192 commit 63e7fa1
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions js/modules/k6/execution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,8 @@ func (o *tagsDynamicObject) Set(key string, val goja.Value) bool {
case
reflect.String,
reflect.Bool,
reflect.Int,
reflect.Int8,
reflect.Int16,
reflect.Int32,
reflect.Int64,
reflect.Uint,
reflect.Uint8,
reflect.Uint16,
reflect.Uint32,
reflect.Uint64,
reflect.Float32,
reflect.Float64,
reflect.Complex64,
reflect.Complex128:

o.State.Tags.Set(key, val.String())
return true
Expand All @@ -267,7 +255,7 @@ func (o *tagsDynamicObject) Set(key string, val goja.Value) bool {
common.Throw(o.Runtime, err)
return false
}
o.State.Logger.Warn("the Set operation has been discarded because" + err.Error())
o.State.Logger.Warnf("the execution.vu.tags.Set('%s') operation has been discarded because %s", key, err.Error())
return false
}
}
Expand Down

0 comments on commit 63e7fa1

Please sign in to comment.