Normalize trims and normalizes the parsed memory header metadata in place.
()
| 28 | |
| 29 | // Normalize trims and normalizes the parsed memory header metadata in place. |
| 30 | func (h *Header) Normalize() { |
| 31 | h.Name = strings.TrimSpace(h.Name) |
| 32 | h.Description = strings.TrimSpace(h.Description) |
| 33 | h.Type = h.Type.Normalize() |
| 34 | h.Scope = h.Scope.Normalize() |
| 35 | h.AgentName = strings.TrimSpace(h.AgentName) |
| 36 | h.AgentTier = h.AgentTier.Normalize() |
| 37 | if h.Provenance != nil { |
| 38 | h.Provenance.Normalize() |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // Validate reports whether the parsed memory header is complete and valid. |
| 43 | func (h *Header) Validate() error { |