Skip to content

Commit

Permalink
Update to golangci-lint 1.40.1.
Browse files Browse the repository at this point in the history
Linter `golint` has been deprecated and replaced with `revive`.
  • Loading branch information
jholdstock committed May 23, 2021
1 parent 2d0db6f commit 136e389
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check out source
uses: actions/checkout@v2
- name: Install Linters
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.38.0"
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.1"
- name: Build
env:
GO111MODULE: "on"
Expand Down
20 changes: 8 additions & 12 deletions database/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package database

import (
"encoding/json"
"errors"
"fmt"
"time"

Expand All @@ -17,25 +16,26 @@ import (
type FeeStatus string

const (
// No fee transaction has been received yet.
// NoFee indicates no fee tx has been received yet.
NoFee FeeStatus = "none"
// Fee transaction has been received but not broadcast.
// FeeReceieved indicates fee tx has been received but not broadcast.
FeeReceieved FeeStatus = "received"
// Fee transaction has been broadcast but not confirmed.
// FeeBroadcast indicates fee tx has been broadcast but not confirmed.
FeeBroadcast FeeStatus = "broadcast"
// Fee transaction has been broadcast and confirmed.
// FeeConfirmed indicates fee tx has been broadcast and confirmed.
FeeConfirmed FeeStatus = "confirmed"
// Fee transaction could not be broadcast due to an error.
// FeeError indicates fee tx could not be broadcast due to an error.
FeeError FeeStatus = "error"
)

// TicketOutcome describes the reason a ticket is no longer votable.
type TicketOutcome string

const (
// Ticket has been revoked, either because it was missed or it expired.
// Revoked indicates the ticket has been revoked, either because it was
// missed or it expired.
Revoked TicketOutcome = "revoked"
// Ticket has already voted.
// Voted indicates the ticket has already voted.
Voted TicketOutcome = "voted"
)

Expand Down Expand Up @@ -77,10 +77,6 @@ func (t *Ticket) FeeExpired() bool {
return now.After(time.Unix(t.FeeExpiration, 0))
}

var (
ErrNoTicketFound = errors.New("no ticket found")
)

// InsertNewTicket will insert the provided ticket into the database. Returns an
// error if either the ticket hash or fee address already exist.
func (vdb *VspDatabase) InsertNewTicket(ticket Ticket) error {
Expand Down
2 changes: 1 addition & 1 deletion database/ticket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"
)

var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano()))

// randString randomly generates a string of the requested length, using only
// characters from the provided charset.
Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fi
golangci-lint run --disable-all --deadline=10m \
--out-format=$OUT_FORMAT \
--enable=gofmt \
--enable=golint \
--enable=revive \
--enable=govet \
--enable=gosimple \
--enable=unconvert \
Expand Down

0 comments on commit 136e389

Please sign in to comment.