MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / push

Method push

opensca/sca/java/xml/marshal.go:1093–1101  ·  view source on GitHub ↗

push adds parent elements to the stack and writes open tags.

(parents []string)

Source from the content-addressed store, hash-verified

1091
1092// push adds parent elements to the stack and writes open tags.
1093func (s *parentStack) push(parents []string) error {
1094 for i := 0; i < len(parents); i++ {
1095 if err := s.p.writeStart(&StartElement{Name: Name{Local: parents[i]}}); err != nil {
1096 return err
1097 }
1098 }
1099 s.stack = append(s.stack, parents...)
1100 return nil
1101}
1102
1103// UnsupportedTypeError is returned when Marshal encounters a type
1104// that cannot be converted into XML.

Callers 1

marshalStructMethod · 0.45

Calls 1

writeStartMethod · 0.80

Tested by

no test coverage detected