package asaModels import "regexp" type ( ContextInfo struct { Mode string `json:"mode"` } ) var ( showModeREGEX = regexp.MustCompile(`(?i)Security\s+context\s+mode:\s+(\S+)`) ) func (c *ContextInfo) Parse(s string) { if !showModeREGEX.MatchString(s) { // "Security context mode" is missing, return return } search := showModeREGEX.FindStringSubmatch(s) if len(search) < 1 { return } c.Mode = search[1] return }