Skip to content

Commit af14797

Browse files
committed
chore: rename the package and docs
1 parent 03f52d4 commit af14797

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# golib
2+
3+
Common go packages.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ardikabs/go-client
1+
module github.com/ardikabs/golib
22

33
go 1.18
44

httpc/options.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package httpc
33
import (
44
"bytes"
55
"encoding/json"
6+
67
"fmt"
8+
"github.com/ardikabs/golib/tool"
79
)
810

911
// WithPath set the URL Path
@@ -121,7 +123,7 @@ func WithRetryOn(retryOn RetryOnKind) Option {
121123
}
122124
case RetryOnGatewayErr:
123125
fn = func(code int) bool {
124-
return In(code, 502, 503, 504)
126+
return tool.In(code, 502, 503, 504)
125127
}
126128
default:
127129
return fmt.Errorf("unknown retry on type")

httpc/request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http/httptest"
99
"testing"
1010

11-
"github.com/ardikabs/go-client/httpc"
11+
"github.com/ardikabs/golib/httpc"
1212
"github.com/stretchr/testify/assert"
1313
"github.com/stretchr/testify/require"
1414
)

httpc/tool.go renamed to tool/tool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package httpc
1+
package tool
22

33
// In returns true if a given value exists in the list.
44
func In[T comparable](value T, list ...T) bool {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
package httpc_test
1+
package tool_test
22

33
import (
44
"testing"
55

6-
"github.com/ardikabs/go-client/httpc"
6+
"github.com/ardikabs/golib/tool"
77
"github.com/stretchr/testify/assert"
88
)
99

1010
func TestIn(t *testing.T) {
1111

1212
t.Run("true", func(t *testing.T) {
13-
val := httpc.In("woman", "man", "woman")
13+
val := tool.In("woman", "man", "woman")
1414
assert.True(t, val)
1515
})
1616

1717
t.Run("false", func(t *testing.T) {
18-
val := httpc.In(5, 1, 2, 3, 4)
18+
val := tool.In(5, 1, 2, 3, 4)
1919
assert.False(t, val)
2020
})
2121
}

0 commit comments

Comments
 (0)