Example #1
0
File: top.go Project: Laller/nocrud
func (t *Top) Get(ret []interface{}, files []string) error {
	ran := verbinfo.NewRanalyzer(ret)
	if ran.HadError() {
		return display.New(t.ctx).Error(ran.Error())
	}
	burnResults(t.ctx.ViewContext(), "main", ran.NonErrors())
	return display.New(t.ctx).Do(files)
}
Example #2
0
File: top.go Project: Laller/nocrud
func (t *Top) Post(ret []interface{}, verb string) error {
	ran := verbinfo.NewRanalyzer(ret)
	var err error
	if ran.HadError() {
		err = ran.Error()
	}
	t.actionResponse(err, verb)
	return nil
}