multi: Use const where possible.
This commit is contained in:
parent
e9cd529de5
commit
f8bd606468
@ -19,7 +19,7 @@ func exampleRecord() VoteChangeRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testVoteChangeRecords(t *testing.T) {
|
func testVoteChangeRecords(t *testing.T) {
|
||||||
hash := "MyHash"
|
const hash = "MyHash"
|
||||||
record := exampleRecord()
|
record := exampleRecord()
|
||||||
|
|
||||||
// Insert a record into the database.
|
// Insert a record into the database.
|
||||||
|
|||||||
@ -57,8 +57,8 @@ func TestIsValidVoteChoices(t *testing.T) {
|
|||||||
func TestIsValidTSpendPolicy(t *testing.T) {
|
func TestIsValidTSpendPolicy(t *testing.T) {
|
||||||
|
|
||||||
// A valid tspend hash is 32 bytes (64 characters).
|
// A valid tspend hash is 32 bytes (64 characters).
|
||||||
validHash := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
const validHash = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||||
anotherValidHash := "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
const anotherValidHash = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
||||||
|
|
||||||
var tests = []struct {
|
var tests = []struct {
|
||||||
tspendPolicy map[string]string
|
tspendPolicy map[string]string
|
||||||
@ -102,8 +102,8 @@ func TestIsValidTSpendPolicy(t *testing.T) {
|
|||||||
func TestIsValidTreasuryPolicy(t *testing.T) {
|
func TestIsValidTreasuryPolicy(t *testing.T) {
|
||||||
|
|
||||||
// A valid treasury key is 33 bytes (66 characters).
|
// A valid treasury key is 33 bytes (66 characters).
|
||||||
validKey := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
const validKey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||||
anotherValidKey := "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
const anotherValidKey = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
||||||
|
|
||||||
var tests = []struct {
|
var tests = []struct {
|
||||||
treasuryPolicy map[string]string
|
treasuryPolicy map[string]string
|
||||||
|
|||||||
@ -56,7 +56,7 @@ func (w *WebAPI) setAltSignAddr(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if currentData != nil {
|
if currentData != nil {
|
||||||
msg := "alternate sign address data already exists"
|
const msg = "alternate sign address data already exists"
|
||||||
w.log.Warnf("%s: %s (ticketHash=%s)", funcName, msg, ticketHash)
|
w.log.Warnf("%s: %s (ticketHash=%s)", funcName, msg, ticketHash)
|
||||||
w.sendErrorWithMsg(msg, types.ErrBadRequest, c)
|
w.sendErrorWithMsg(msg, types.ErrBadRequest, c)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user