(seed int, features []string)
| 39 | var templateRegex = regexp.MustCompile(`<[^>]+>`) |
| 40 | |
| 41 | func generateSpanName(seed int, features []string) string { |
| 42 | r := rand.New(rand.NewSource(int64(seed))) //nolint:gosec |
| 43 | feature := features[r.Intn(len(features))] |
| 44 | |
| 45 | return templateRegex.ReplaceAllStringFunc(feature, func(match string) string { |
| 46 | return generateFeature(match, r) |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | func generateFeature(feature string, r *rand.Rand) string { |
| 51 | switch feature { |
no test coverage detected