From bbd6591c4f87b3f2c3e870b6418c6234d90a82e6 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 21 May 2022 20:31:09 +0200 Subject: go fmt --- pkg/log/log.go | 8 ++++---- pkg/requests/requests.go | 12 ++++++------ pkg/requests/requests_test.go | 10 +++++----- pkg/types/leaf.go | 16 ++++++++-------- pkg/types/proof.go | 2 +- pkg/types/tree_head.go | 10 +++++----- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pkg/log/log.go b/pkg/log/log.go index 5df9aee..fba9288 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -45,11 +45,11 @@ const ( ) type logger struct { - log.Logger // Default writer: os.Stderr. + log.Logger // Default writer: os.Stderr. - lv level // Logging level. Default: InfoLevel. - date bool // Logging dates or not: Default: true. - color bool // Using colors or not: Default: false. + lv level // Logging level. Default: InfoLevel. + date bool // Logging dates or not: Default: true. + color bool // Using colors or not: Default: false. } var l logger diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index 6b74184..cfaaf29 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -13,11 +13,11 @@ import ( ) type Leaf struct { - ShardHint uint64 `ascii:"shard_hint"` - Message merkle.Hash `ascii:"message"` - Signature types.Signature `ascii:"signature"` - PublicKey types.PublicKey `ascii:"public_key"` - DomainHint string `ascii:"domain_hint"` + ShardHint uint64 `ascii:"shard_hint"` + Message merkle.Hash `ascii:"message"` + Signature types.Signature `ascii:"signature"` + PublicKey types.PublicKey `ascii:"public_key"` + DomainHint string `ascii:"domain_hint"` } type Leaves struct { @@ -37,7 +37,7 @@ type ConsistencyProof struct { type Cosignature struct { Cosignature types.Signature `ascii:"cosignature"` - KeyHash merkle.Hash `ascii:"key_hash"` + KeyHash merkle.Hash `ascii:"key_hash"` } func (req *Leaf) ToASCII(w io.Writer) error { diff --git a/pkg/requests/requests_test.go b/pkg/requests/requests_test.go index db809c0..b4dfc70 100644 --- a/pkg/requests/requests_test.go +++ b/pkg/requests/requests_test.go @@ -221,11 +221,11 @@ func TestCosignatureFromASCII(t *testing.T) { func validLeaf(t *testing.T) *Leaf { t.Helper() return &Leaf{ - ShardHint: 1, - Message: *newHashBufferInc(t), - Signature: *newSigBufferInc(t), - PublicKey: *newPubBufferInc(t), - DomainHint: "example.com", + ShardHint: 1, + Message: *newHashBufferInc(t), + Signature: *newSigBufferInc(t), + PublicKey: *newPubBufferInc(t), + DomainHint: "example.com", } } diff --git a/pkg/types/leaf.go b/pkg/types/leaf.go index 9e8d445..99cf08a 100644 --- a/pkg/types/leaf.go +++ b/pkg/types/leaf.go @@ -12,14 +12,14 @@ import ( ) type Statement struct { - ShardHint uint64 `ascii:"shard_hint"` - Checksum merkle.Hash `ascii:"checksum"` + ShardHint uint64 `ascii:"shard_hint"` + Checksum merkle.Hash `ascii:"checksum"` } type Leaf struct { Statement - Signature Signature `ascii:"signature"` - KeyHash merkle.Hash `ascii:"key_hash"` + Signature Signature `ascii:"signature"` + KeyHash merkle.Hash `ascii:"key_hash"` } type Leaves []Leaf @@ -84,10 +84,10 @@ func (l *Leaf) FromASCII(r io.Reader) error { func (l *Leaves) FromASCII(r io.Reader) error { leaves := &struct { - ShardHint []uint64 `ascii:"shard_hint"` - Checksum []merkle.Hash `ascii:"checksum"` - Signature []Signature `ascii:"signature"` - KeyHash []merkle.Hash `ascii:"key_hash"` + ShardHint []uint64 `ascii:"shard_hint"` + Checksum []merkle.Hash `ascii:"checksum"` + Signature []Signature `ascii:"signature"` + KeyHash []merkle.Hash `ascii:"key_hash"` }{} if err := ascii.StdEncoding.Deserialize(r, leaves); err != nil { diff --git a/pkg/types/proof.go b/pkg/types/proof.go index f2df332..dd136d6 100644 --- a/pkg/types/proof.go +++ b/pkg/types/proof.go @@ -9,7 +9,7 @@ import ( type InclusionProof struct { TreeSize uint64 - LeafIndex uint64 `ascii:"leaf_index"` + LeafIndex uint64 `ascii:"leaf_index"` Path []merkle.Hash `ascii:"inclusion_path"` } diff --git a/pkg/types/tree_head.go b/pkg/types/tree_head.go index 04b3b10..baedf08 100644 --- a/pkg/types/tree_head.go +++ b/pkg/types/tree_head.go @@ -13,9 +13,9 @@ import ( ) type TreeHead struct { - Timestamp uint64 `ascii:"timestamp"` - TreeSize uint64 `ascii:"tree_size"` - RootHash merkle.Hash `ascii:"root_hash"` + Timestamp uint64 `ascii:"timestamp"` + TreeSize uint64 `ascii:"tree_size"` + RootHash merkle.Hash `ascii:"root_hash"` } type SignedTreeHead struct { @@ -25,8 +25,8 @@ type SignedTreeHead struct { type CosignedTreeHead struct { SignedTreeHead - Cosignature []Signature `ascii:"cosignature"` - KeyHash []merkle.Hash `ascii:"key_hash"` + Cosignature []Signature `ascii:"cosignature"` + KeyHash []merkle.Hash `ascii:"key_hash"` } func (th *TreeHead) toBinary() []byte { -- cgit v1.2.3