MCPcopy
hub / github.com/fluid-cloudnative/fluid / FillSliceWithString

Function FillSliceWithString

pkg/utils/slice.go:20–28  ·  view source on GitHub ↗

FillSliceWithString fills a slice with repeated given string

(str string, num int)

Source from the content-addressed store, hash-verified

18
19// FillSliceWithString fills a slice with repeated given string
20func FillSliceWithString(str string, num int) *[]string {
21 retSlice := make([]string, num)
22
23 for i := 0; i < num; i++ {
24 retSlice[i] = str
25 }
26
27 return &retSlice
28}
29
30// SubtractString returns the subtraction between two string slice
31func SubtractString(x []string, y []string) []string {

Callers 4

transformCommonPartMethod · 0.92
transformCommonPartMethod · 0.92
TestFillSliceWithStringFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFillSliceWithStringFunction · 0.68