Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated github actions #115

Merged
merged 1 commit into from Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18

- name: Test
run: go test ./...
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint-test.yml
Expand Up @@ -11,10 +11,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.3.0
with:
version: latest
args: --timeout 5m
working-directory: .
working-directory: .
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/projectdiscovery/chaos-client

go 1.17
go 1.18

require (
github.com/json-iterator/go v1.1.12
Expand Down
11 changes: 5 additions & 6 deletions pkg/chaos/chaos.go
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"strings"

Expand Down Expand Up @@ -51,7 +50,7 @@ func (c *Client) GetStatistics(req *GetStatisticsRequest) (*GetStatisticsRespons
}

if resp.StatusCode != http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, errors.Wrap(err, "could not read response.")
}
Expand Down Expand Up @@ -102,7 +101,7 @@ func (c *Client) GetSubdomains(req *SubdomainsRequest) chan *Result {
}

if resp.StatusCode != http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
results <- &Result{Error: errors.Wrap(err, "could not read response.")}
return
Expand Down Expand Up @@ -195,7 +194,7 @@ func (c *Client) GetBBQSubdomains(req *SubdomainsRequest) chan *BBQResult {
}

if resp.StatusCode != http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
results <- &BBQResult{Error: errors.Wrap(err, "could not read response.")}
return
Expand Down Expand Up @@ -247,13 +246,13 @@ func (c *Client) PutSubdomains(req *PutSubdomainsRequest) (*PutSubdomainsRespons
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, errors.Wrap(err, "could not read response.")
}
return nil, InvalidStatusCodeError{StatusCode: resp.StatusCode, Message: body}
}
_, _ = io.Copy(ioutil.Discard, resp.Body)
_, _ = io.Copy(io.Discard, resp.Body)
return &PutSubdomainsResponse{}, nil
}

Expand Down