fix go 1.15 build warning (#729)

This commit is contained in:
Kevin Davis 2020-12-03 16:07:47 -07:00 committed by GitHub
parent 01311e77f6
commit 4c95227c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -42,7 +42,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
seenIDS := make(map[string]bool) seenIDS := make(map[string]bool)
var key string var key string
for _, gcp := range gcps { for _, gcp := range gcps {
key = gcp.CollateralType + string(gcp.ID) key = gcp.CollateralType + fmt.Sprint(gcp.ID)
if seenIDS[key] { if seenIDS[key] {
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType) return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
} }
@ -445,7 +445,7 @@ func (cps ClaimPeriods) Validate() error {
seenPeriods := make(map[string]bool) seenPeriods := make(map[string]bool)
var key string var key string
for _, cp := range cps { for _, cp := range cps {
key = cp.CollateralType + string(cp.ID) key = cp.CollateralType + fmt.Sprint(cp.ID)
if seenPeriods[key] { if seenPeriods[key] {
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType) return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
} }
@ -513,7 +513,7 @@ func (cs Claims) Validate() error {
seemClaims := make(map[string]bool) seemClaims := make(map[string]bool)
var key string var key string
for _, c := range cs { for _, c := range cs {
key = c.CollateralType + string(c.ClaimPeriodID) + c.Owner.String() key = c.CollateralType + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
if c.Owner != nil && seemClaims[key] { if c.Owner != nil && seemClaims[key] {
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType) return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
} }

View File

@ -35,7 +35,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
seenIDS := make(map[string]bool) seenIDS := make(map[string]bool)
var key string var key string
for _, gcp := range gcps { for _, gcp := range gcps {
key = gcp.Denom + string(gcp.ID) key = gcp.Denom + fmt.Sprint(gcp.ID)
if seenIDS[key] { if seenIDS[key] {
return fmt.Errorf("duplicated genesis claim period with id %d and denom %s", gcp.ID, gcp.Denom) return fmt.Errorf("duplicated genesis claim period with id %d and denom %s", gcp.ID, gcp.Denom)
} }
@ -352,7 +352,7 @@ func (cps ClaimPeriods) Validate() error {
seenPeriods := make(map[string]bool) seenPeriods := make(map[string]bool)
var key string var key string
for _, cp := range cps { for _, cp := range cps {
key = cp.Denom + string(cp.ID) key = cp.Denom + fmt.Sprint(cp.ID)
if seenPeriods[key] { if seenPeriods[key] {
return fmt.Errorf("duplicated claim period with id %d and denom %s", cp.ID, cp.Denom) return fmt.Errorf("duplicated claim period with id %d and denom %s", cp.ID, cp.Denom)
} }
@ -417,7 +417,7 @@ func (cs Claims) Validate() error {
seemClaims := make(map[string]bool) seemClaims := make(map[string]bool)
var key string var key string
for _, c := range cs { for _, c := range cs {
key = c.Denom + string(c.ClaimPeriodID) + c.Owner.String() key = c.Denom + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
if c.Owner != nil && seemClaims[key] { if c.Owner != nil && seemClaims[key] {
return fmt.Errorf("duplicated claim from owner %s and denom %s", c.Owner, c.Denom) return fmt.Errorf("duplicated claim from owner %s and denom %s", c.Owner, c.Denom)
} }

View File

@ -34,7 +34,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
seenIDS := make(map[string]bool) seenIDS := make(map[string]bool)
var key string var key string
for _, gcp := range gcps { for _, gcp := range gcps {
key = gcp.CollateralType + string(gcp.ID) key = gcp.CollateralType + fmt.Sprint(gcp.ID)
if seenIDS[key] { if seenIDS[key] {
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType) return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
} }

View File

@ -154,7 +154,7 @@ func (cps ClaimPeriods) Validate() error {
seenPeriods := make(map[string]bool) seenPeriods := make(map[string]bool)
var key string var key string
for _, cp := range cps { for _, cp := range cps {
key = cp.CollateralType + string(cp.ID) key = cp.CollateralType + fmt.Sprint(cp.ID)
if seenPeriods[key] { if seenPeriods[key] {
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType) return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
} }
@ -251,7 +251,7 @@ func (cs Claims) Validate() error {
seemClaims := make(map[string]bool) seemClaims := make(map[string]bool)
var key string var key string
for _, c := range cs { for _, c := range cs {
key = c.CollateralType + string(c.ClaimPeriodID) + c.Owner.String() key = c.CollateralType + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
if c.Owner != nil && seemClaims[key] { if c.Owner != nil && seemClaims[key] {
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType) return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
} }