MCPcopy Create free account
hub / github.com/conforma/cli / String

Method String

internal/tracing/type.go:92–115  ·  view source on GitHub ↗

String returns a comma separated list of enabled categories

()

Source from the content-addressed store, hash-verified

90
91// String returns a comma separated list of enabled categories
92func (t Trace) String() string {
93 if t == None {
94 return "none"
95 }
96
97 s := ""
98 if t.Enabled(Perf) {
99 s += "perf,"
100 }
101 if t.Enabled(CPU) {
102 s += "cpu,"
103 }
104 if t.Enabled(Memory) {
105 s += "mem,"
106 }
107 if t.Enabled(Opa) {
108 s += "opa,"
109 }
110 if t.Enabled(Log) {
111 s += "log,"
112 }
113
114 return strings.TrimRight(s, ",")
115}
116
117// WithTrace returns the context with the given Trace
118func WithTrace(ctx context.Context, t Trace) context.Context {

Callers 15

itemsFunction · 0.45
mainFunction · 0.45
referrersFunction · 0.45
relatedFunction · 0.45
joinStrSliceFunction · 0.45
TestSetupTemplateFunction · 0.45
TestTemplateHelpersFunction · 0.45
ResolveDigestMethod · 0.45
ResolveDigestMethod · 0.45
GetPolicyMethod · 0.45
PolicyUrlMethod · 0.45
SubdirMethod · 0.45

Calls 1

EnabledMethod · 0.95

Tested by 15

TestSetupTemplateFunction · 0.36
TestTemplateHelpersFunction · 0.36
GetPolicyMethod · 0.36
PolicyUrlMethod · 0.36
SubdirMethod · 0.36
TestOCITracingFunction · 0.36
Test_PrintExpectedJSONFunction · 0.36
TestOCIParsedBlobFunction · 0.36
TestOCIImageFilesFunction · 0.36
TestOCIImageTagRefsFunction · 0.36