From e33f80e57f273010ab377696f162539dc4c0b268 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 26 Mar 2022 21:43:59 -0500 Subject: [PATCH] add error to http request --- task/http_request.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/task/http_request.go b/task/http_request.go index 8eb1930..aac4eeb 100644 --- a/task/http_request.go +++ b/task/http_request.go @@ -19,6 +19,14 @@ type HttpRequest[T any] struct { err error } +func (r *HttpRequest[T]) Ans() T { + return r.ans +} + +func (r *HttpRequest[T]) Err() error { + return r.err +} + func (r *HttpRequest[T]) String() string { return fmt.Sprintf("%+v", r.ans) }