1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

fix: http interface of IOEither

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-11-27 12:11:23 +01:00
parent 211340952b
commit 01f14a327a
4 changed files with 100 additions and 33 deletions

View File

@@ -23,7 +23,6 @@ import (
AR "github.com/IBM/fp-go/array"
E "github.com/IBM/fp-go/either"
HE "github.com/IBM/fp-go/either/http"
"github.com/IBM/fp-go/errors"
F "github.com/IBM/fp-go/function"
IOE "github.com/IBM/fp-go/ioeither"
@@ -53,10 +52,9 @@ func TestRetryHttp(t *testing.T) {
client := MakeClient(&http.Client{})
action := func(status R.RetryStatus) IOE.IOEither[error, *PostItem] {
return F.Pipe2(
HE.GetRequest(urls[status.IterNumber]),
IOE.FromEither[error, *http.Request],
IOE.Chain(ReadJson[*PostItem](client)),
return F.Pipe1(
MakeGetRequest(urls[status.IterNumber]),
ReadJson[*PostItem](client),
)
}