MCPcopy Index your code
hub / github.com/XmirrorSecurity/OpenSCA-cli / CopyToken

Function CopyToken

opensca/sca/java/xml/xml.go:113–127  ·  view source on GitHub ↗

CopyToken returns a copy of a Token.

(t Token)

Source from the content-addressed store, hash-verified

111
112// CopyToken returns a copy of a Token.
113func CopyToken(t Token) Token {
114 switch v := t.(type) {
115 case CharData:
116 return v.Copy()
117 case Comment:
118 return v.Copy()
119 case Directive:
120 return v.Copy()
121 case ProcInst:
122 return v.Copy()
123 case StartElement:
124 return v.Copy()
125 }
126 return t
127}
128
129// A TokenReader is anything that can decode a stream of XML tokens, including a
130// Decoder.

Callers

nothing calls this directly

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected