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

all: staticcheck fixes #4239

Merged
merged 2 commits into from
Feb 23, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions historyarchive/http_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func checkResp(r *http.Response) error {
}

func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error) {
var derived url.URL = b.base
derived := b.base
derived.Path = path.Join(derived.Path, pth)
req, err := http.NewRequest("GET", derived.String(), nil)
if err != nil {
Expand All @@ -58,7 +58,7 @@ func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error) {
}

func (b *HttpArchiveBackend) Head(pth string) (*http.Response, error) {
var derived url.URL = b.base
derived := b.base
derived.Path = path.Join(derived.Path, pth)
req, err := http.NewRequest("HEAD", derived.String(), nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ingest/ledgerbackend/stellar_core_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (r *stellarCoreRunner) handleExit() {

// Pattern recommended in:
// https://github.com/golang/go/blob/cacac8bdc5c93e7bc71df71981fdf32dded017bf/src/cmd/go/script_test.go#L1091-L1098
var interrupt os.Signal = os.Interrupt
interrupt := os.Interrupt
if runtime.GOOS == "windows" {
// Per https://golang.org/pkg/os/#Signal, “Interrupt is not implemented on
// Windows; using it with os.Process.Signal will return an error.”
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/txsub/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (sys *System) Tick(ctx context.Context) {

// In Tick we only check txs in a queue so those which did not have results before Tick
// so we check for them in the last 5 mins of ledgers: 60.
var sinceLedgerSeq int32 = int32(latestLedger) - 60
sinceLedgerSeq := int32(latestLedger) - 60
if sinceLedgerSeq < 0 {
sinceLedgerSeq = 0
}
Expand Down
2 changes: 1 addition & 1 deletion tools/archive-reader/archive_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func main() {
ledgerPtr := flag.Uint64("ledger", 0, "`ledger to analyze` (tip: has to be of the form `ledger = 64*n - 1`, where n is > 0)")
flag.Parse()
var seqNum uint32 = uint32(*ledgerPtr)
seqNum := uint32(*ledgerPtr)

if seqNum == 0 {
flag.Usage()
Expand Down