packagehttpexpecttypechainstruct{reporterReporterfailbitbool}funcmakeChain(reporterReporter)chain{returnchain{reporter,false}}func(c*chain)failed()bool{returnc.failbit}func(c*chain)fail(messagestring,args...interface{}){ifc.failbit{return}c.failbit=truec.reporter.Errorf(message,args...)}func(c*chain)reset(){c.failbit=false}func(c*chain)assertFailed(rReporter){if!c.failbit{r.Errorf("expected chain is failed, but it's ok")}}func(c*chain)assertOK(rReporter){ifc.failbit{r.Errorf("expected chain is ok, but it's failed")}}