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

Function procInst

opensca/sca/java/xml/xml.go:2041–2057  ·  view source on GitHub ↗

procInst parses the `param="..."` or `param='...'` value out of the provided string, returning "" if not found.

(param, s string)

Source from the content-addressed store, hash-verified

2039// procInst parses the `param="..."` or `param='...'`
2040// value out of the provided string, returning "" if not found.
2041func procInst(param, s string) string {
2042 // TODO: this parsing is somewhat lame and not exact.
2043 // It works for all actual cases, though.
2044 param = param + "="
2045 _, v, _ := strings.Cut(s, param)
2046 if v == "" {
2047 return ""
2048 }
2049 if v[0] != '\'' && v[0] != '"' {
2050 return ""
2051 }
2052 unquote, _, ok := strings.Cut(v[1:], v[:1])
2053 if !ok {
2054 return ""
2055 }
2056 return unquote
2057}

Callers 1

rawTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected