package pkg import ( "regexp" "github.rackspace.com/gorax/tools/util" ) type ( Verify struct { Md5 *string `json:"md5,omitempty"` FileName *string `json:"filename"` } ) func ParseVerify(s string) (v *Verify) { v = new(Verify) nf := util.RegexpString(regexp.MustCompile(`(?i)(no\s+such\s+file\s+or\s+directory)`), s) if nf != "" { return } m := util.RegexpString(regexp.MustCompile(`(?i)\s+.*'\n+(\S+)`), s) fn := util.RegexpString(regexp.MustCompile(`(?i)\s+.*'\n+\S+\s+(\S+)`), s) v.Md5 = &m v.FileName = &fn return }