Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentysc committed Nov 25, 2024
1 parent a767924 commit 634d617
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion external/json/numeric_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (u NumericString) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", u.String())), nil
}

func (u *NumericString) UnmarshalJSON(data []byte) error {
func (u NumericString) UnmarshalJSON(data []byte) error {
var untypedVal interface{}
if err := jsoniter.Unmarshal(data, &untypedVal); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion external/json/uint32.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (u Uint32) MarshalJSON() ([]byte, error) {
return []byte(u.String()), nil
}

func (u *Uint32) UnmarshalJSON(data []byte) error {
func (u Uint32) UnmarshalJSON(data []byte) error {
// Ignore null, like in the main JSON package.
if string(data) == "null" {
return nil
Expand Down
2 changes: 1 addition & 1 deletion external/utctime/utctime.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (t UTCTime) MarshalJSON() ([]byte, error) {
return result, nil
}

func (t *UTCTime) UnmarshalJSON(data []byte) error {
func (t UTCTime) UnmarshalJSON(data []byte) error {
var timeVal gotime.Time
if err := jsoniter.Unmarshal(data, &timeVal); err != nil {
return err
Expand Down
9 changes: 5 additions & 4 deletions projection/chainstats/chainstats_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package chainstats_test

import (
"github.com/crypto-com/chain-indexing/usecase/model/genesis"
"path"
"runtime"
"time"

"github.com/crypto-com/chain-indexing/usecase/model/genesis"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Expand Down Expand Up @@ -33,14 +34,14 @@ var _ = Describe("Chain Stats", func() {
Describe("genesis time parsing learning test", func() {
It("should parse correctly different variations of time format", func() {
Expect(
utctime.MustParse(time.RFC3339, "2021-03-25T01:00:00Z").UnixNano(),
utctime.MustParse(time.RFC3339, "2021-03-25T01:00:00Z"),
).To(Equal(int64(1616634000000000000)))

Expect(
utctime.MustParse("2006-01-02T15:04:05.000000Z", "2020-12-23T07:30:28.674523Z").UnixNano(),
utctime.MustParse("2006-01-02T15:04:05.000000Z", "2020-12-23T07:30:28.674523Z"),
).To(Equal(int64(1608708628674523000)))
Expect(
utctime.MustParse(time.RFC3339, "2020-12-23T07:30:28.674523Z").UnixNano(),
utctime.MustParse(time.RFC3339, "2020-12-23T07:30:28.674523Z"),
).To(Equal(int64(1608708628674523000)))
})
})
Expand Down
2 changes: 1 addition & 1 deletion usecase/coin/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (u Uint) MarshalJSON() ([]byte, error) {
}

// UnmarshalJSON defines custom decoding scheme
func (u *Uint) UnmarshalJSON(bz []byte) error {
func (u Uint) UnmarshalJSON(bz []byte) error {
if u.i == nil { // Necessary since default Uint initialization has i.i as nil
u.i = new(big.Int)
}
Expand Down

0 comments on commit 634d617

Please sign in to comment.