Skip to content

Commit 209d815

Browse files
Merge pull request #33 from goark/fix-bugs-and-testing
Bump up external packages
2 parents 401b112 + 2a4615a commit 209d815

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

.github/workflows/vulns.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-go@v3
1414
with:
15-
go-version: ^1.20
15+
go-version-file: 'go.mod'
1616
- name: WriteGoList
1717
run: go list -json -m all > go.list
1818
- name: Nancy

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tasks:
1212
cmds:
1313
- go mod verify
1414
- go test -shuffle on ./...
15-
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run --enable gosec --timeout 3m0s ./...
15+
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.55.2 golangci-lint run --enable gosec --timeout 3m0s ./...
1616
sources:
1717
- ./go.mod
1818
- '**/*.go'
@@ -28,4 +28,4 @@ tasks:
2828
clean:
2929
desc: Initialize module and build cache, and remake go.sum file.
3030
cmds:
31-
- go mod tidy -v -go=1.20
31+
- go mod tidy -v -go=1.21

client.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const (
1717
defaultPartnerType = "Associates"
1818
)
1919

20-
//Query interface for Client type
20+
// Query interface for Client type
2121
type Query interface {
2222
Operation() Operation
2323
Payload() ([]byte, error)
2424
}
2525

26-
//Client interface
26+
// Client interface
2727
type Client interface {
2828
Marketplace() string
2929
PartnerTag() string
@@ -32,7 +32,7 @@ type Client interface {
3232
RequestContext(context.Context, Query) ([]byte, error)
3333
}
3434

35-
//client is http.Client for Aozora API Server
35+
// client is http.Client for Aozora API Server
3636
type client struct {
3737
server *Server
3838
client fetch.Client
@@ -41,27 +41,27 @@ type client struct {
4141
secretKey string
4242
}
4343

44-
//Marketplace returns name of Marketplace parameter for PA-API v5
44+
// Marketplace returns name of Marketplace parameter for PA-API v5
4545
func (c *client) Marketplace() string {
4646
return c.server.Marketplace()
4747
}
4848

49-
//PartnerTag returns PartnerTag parameter for PA-API v5
49+
// PartnerTag returns PartnerTag parameter for PA-API v5
5050
func (c *client) PartnerTag() string {
5151
return c.partnerTag
5252
}
5353

54-
//PartnerType returns PartnerType parameter for PA-API v5
54+
// PartnerType returns PartnerType parameter for PA-API v5
5555
func (c *client) PartnerType() string {
5656
return defaultPartnerType
5757
}
5858

59-
//Request method returns response data (JSON format) by PA-APIv5.
59+
// Request method returns response data (JSON format) by PA-APIv5.
6060
func (c *client) Request(q Query) ([]byte, error) {
6161
return c.RequestContext(context.Background(), q)
6262
}
6363

64-
//RequestContext method returns response data (JSON format) by PA-APIv5. (with context.Context)
64+
// RequestContext method returns response data (JSON format) by PA-APIv5. (with context.Context)
6565
func (c *client) RequestContext(ctx context.Context, q Query) ([]byte, error) {
6666
payload, err := q.Payload()
6767
if err != nil {
@@ -79,10 +79,10 @@ func (c *client) post(ctx context.Context, cmd Operation, payload []byte) ([]byt
7979
u := c.server.URL(cmd.Path())
8080
hds := newHeaders(c.server, cmd, dt)
8181
sig := c.signiture(c.signedString(hds, payload), hds)
82-
resp, err := c.client.Post(
82+
resp, err := c.client.PostWithContext(
83+
ctx,
8384
u,
8485
bytes.NewReader(payload),
85-
fetch.WithContext(ctx),
8686
fetch.WithRequestHeaderSet("Accept", c.server.Accept()),
8787
fetch.WithRequestHeaderSet("Accept-Language", c.server.AcceptLanguage()),
8888
fetch.WithRequestHeaderSet("Content-Type", c.server.ContentType()),

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/goark/pa-api
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/goark/errs v1.1.0
7-
github.com/goark/fetch v0.3.0
6+
github.com/goark/errs v1.3.2
7+
github.com/goark/fetch v0.4.1
88
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github.com/goark/errs v1.1.0 h1:FKnyw4LVyRADIjM8Nj0Up6r0/y5cfADvZAd1E+tthXE=
2-
github.com/goark/errs v1.1.0/go.mod h1:TtaPEoadm2mzqzfXdkkfpN2xuniCFm2q4JH+c1qzaqw=
3-
github.com/goark/fetch v0.3.0 h1:2m32EGOLBi99RzI5urFfmv5++CMqfenVw7NH8z/lbX8=
4-
github.com/goark/fetch v0.3.0/go.mod h1:sqDdPbbHeIjDVeHrgvzhHpkUr8X9pVC9DgJoVwU02x0=
1+
github.com/goark/errs v1.3.2 h1:ifccNe1aK7Xezt4XVYwHUqalmnfhuphnEvh3FshCReQ=
2+
github.com/goark/errs v1.3.2/go.mod h1:ZsQucxaDFVfSB8I99j4bxkDRfNOrlKINwg72QMuRWKw=
3+
github.com/goark/fetch v0.4.1 h1:Y59g9sAdgqjPS7UADdLIoQGRxJE1WMo5ixlJi/ZcCfc=
4+
github.com/goark/fetch v0.4.1/go.mod h1:umZxLIJHa15J8EQSp5zft1dHDv0VGwmQL6pOfaJ60FY=

0 commit comments

Comments
 (0)