chore: fix linting issues exposed by fixing golangci-lint (#12895)
Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Marko
Julien Robert
parent
15b04c2a87
commit
0943a70215
@@ -62,8 +62,10 @@ var lock = new(sync.Mutex)
|
||||
|
||||
// AppConstructor defines a function which accepts a network configuration and
|
||||
// creates an ABCI Application to provide to Tendermint.
|
||||
type AppConstructor = func(val moduletestutil.Validator) servertypes.Application
|
||||
type TestFixtureFactory = func() TestFixture
|
||||
type (
|
||||
AppConstructor = func(val moduletestutil.Validator) servertypes.Application
|
||||
TestFixtureFactory = func() TestFixture
|
||||
)
|
||||
|
||||
type TestFixture struct {
|
||||
AppConstructor AppConstructor
|
||||
|
||||
@@ -3,7 +3,7 @@ package network
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
@@ -200,7 +200,7 @@ func writeFile(name string, dir string, contents []byte) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(file, contents, 0o644) // nolint: gosec
|
||||
err = os.WriteFile(file, contents, 0o644) //nolint: gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
|
||||
// An error is returned if the request or reading the body fails.
|
||||
func GetRequest(url string) ([]byte, error) {
|
||||
res, err := http.Get(url) // nolint:gosec
|
||||
res, err := http.Get(url) //nolint:gosec
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func GetRequest(url string) ([]byte, error) {
|
||||
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
|
||||
// An error is returned if the request or reading the body fails.
|
||||
func PostRequest(url string, contentType string, data []byte) ([]byte, error) {
|
||||
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) // nolint:gosec
|
||||
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) //nolint:gosec
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error while sending post request: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user