MCPcopy Create free account
hub / github.com/celer-pkg/celer / string

Method string

pkgcache/divider.go:10–35  ·  view source on GitHub ↗
(parents []string, args ...string)

Source from the content-addressed store, hash-verified

8type divider struct{}
9
10func (d divider) string(parents []string, args ...string) string {
11 var buffer bytes.Buffer
12
13 for index, parent := range parents {
14 if index == 0 {
15 buffer.WriteString(parent)
16 } else {
17 buffer.WriteString(" <<< ")
18 buffer.WriteString(parent)
19 }
20 }
21
22 for _, arg := range args {
23 if arg == "" {
24 continue
25 }
26
27 if buffer.Len() == 0 {
28 buffer.WriteString(arg)
29 } else {
30 buffer.WriteString(" <<< ")
31 buffer.WriteString(arg)
32 }
33 }
34 return fmt.Sprintf("# -------- %s --------\n", buffer.String())
35}
36
37func newDivider(parents []string, args ...string) string {
38 return divider{}.string(parents, args...)

Callers 1

newDividerFunction · 0.80

Calls 2

SprintfMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected