Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ugol committed Jul 18, 2024
1 parent 0bf81eb commit 74db1ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/functions/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,3 @@ func InitCSV(csvpath string) {
}

}

// Inject is used to inject a different string value with a given probability, typically used to generate a bad value
func Inject(probability float64, injected, original string) string {
if rand.Float64() < probability {
return injected
}
return original
}
8 changes: 8 additions & 0 deletions pkg/functions/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ func Contains(s []string, str string) bool {
return false
}

// Inject is used to inject a different string value with a given probability, typically used to generate a bad value
func Inject(probability float64, injected, original string) string {
if Random.Float64() < probability {
return injected
}
return original
}

// get the label value from csv file
func fromcsv(c string) string {
ctx.JrContext.CtxCSVLock.Lock()
Expand Down

0 comments on commit 74db1ed

Please sign in to comment.