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

Method Close

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

Close the Encoder, indicating that no more data will be written. It flushes any buffered XML to the underlying writer and returns an error if the written XML is invalid (e.g. by containing unclosed elements).

()

Source from the content-addressed store, hash-verified

1015// any buffered XML to the underlying writer and returns an error if the
1016// written XML is invalid (e.g. by containing unclosed elements).
1017func (p *printer) Close() error {
1018 if p.closed {
1019 return nil
1020 }
1021 p.closed = true
1022 if err := p.w.Flush(); err != nil {
1023 return err
1024 }
1025 if len(p.tags) > 0 {
1026 return fmt.Errorf("unclosed tag <%s>", p.tags[len(p.tags)-1].Local)
1027 }
1028 return nil
1029}
1030
1031// return the bufio Writer's cached write error
1032func (p *printer) cachedWriteError() error {

Callers

nothing calls this directly

Calls 1

FlushMethod · 0.45

Tested by

no test coverage detected