示例#1
0
文件: pkg.go 项目: sneha29shukla/mig
func buildResults(e elements, r *modules.Result) (buf []byte, err error) {
	r.Success = true
	r.Elements = e
	if len(e.Packages) > 0 {
		r.FoundAnything = true
	}
	endCounters()
	r.Statistics = stats
	buf, err = json.Marshal(r)
	return
}
示例#2
0
文件: scribe.go 项目: agnivesh/mig
func buildResults(e ScribeElements, r *modules.Result) (buf []byte, err error) {
	r.Success = true
	r.Elements = e
	if len(e.Results) > 0 {
		r.FoundAnything = true
	}
	// If any tests resulted in an error, store them as errors in the command.
	for _, x := range e.Results {
		if x.IsError {
			es := fmt.Sprintf("Error: %v in \"%v\"", x.Error, x.TestID)
			r.Errors = append(r.Errors, es)
		}
	}
	endCounters()
	r.Statistics = stats
	buf, err = json.Marshal(r)
	return
}