This commit is contained in:
a 2022-03-26 21:46:04 -05:00
parent 6b99c8e0aa
commit 4b8ccf12b4
1 changed files with 6 additions and 6 deletions

View File

@ -32,6 +32,12 @@ func (r *HttpRequest[T]) String() string {
return fmt.Sprintf("%+v", r.ans) return fmt.Sprintf("%+v", r.ans)
} }
func (_ *HttpRequest[T]) NoErr() func(r *HttpRequest[T]) bool {
return func(r *HttpRequest[T]) bool {
return r.err == nil
}
}
func (_ *HttpRequest[T]) With(df DecoderFunc) func(r *HttpRequest[T]) *HttpRequest[T] { func (_ *HttpRequest[T]) With(df DecoderFunc) func(r *HttpRequest[T]) *HttpRequest[T] {
return func(r *HttpRequest[T]) *HttpRequest[T] { return func(r *HttpRequest[T]) *HttpRequest[T] {
r.ans = *new(T) r.ans = *new(T)
@ -57,9 +63,3 @@ func (z *HttpRequest[T]) Xml() func(r *HttpRequest[T]) *HttpRequest[T] {
return xml.NewDecoder(r) return xml.NewDecoder(r)
}) })
} }
func (_ *HttpRequest[T]) NoErr() func(r *HttpRequest[T]) bool {
return func(r *HttpRequest[T]) bool {
return r.err == nil
}
}