Skip to content

Commit 89d9413

Browse files
authored
chore: make golines (#1095)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 6caaf31 commit 89d9413

File tree

4 files changed

+40
-9
lines changed

4 files changed

+40
-9
lines changed

ledger/common/script_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ func TestScriptRefDecode(t *testing.T) {
3333
t.Fatalf("unexpected error decoding script ref CBOR: %s", err)
3434
}
3535
if !reflect.DeepEqual(testScriptRef.Script, &expectedScript) {
36-
t.Fatalf("did not get expected script\n got: %#v\n wanted: %#v", testScriptRef.Script, &expectedScript)
36+
t.Fatalf(
37+
"did not get expected script\n got: %#v\n wanted: %#v",
38+
testScriptRef.Script,
39+
&expectedScript,
40+
)
3741
}
3842
}

ledger/conway/block_test.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) {
3535
// Decode the hex string into CBOR bytes
3636
dataBytes, err := hex.DecodeString(hexStr)
3737
if err != nil {
38-
t.Fatalf("Failed to decode Conway block hex string into CBOR bytes: %v", err)
38+
t.Fatalf(
39+
"Failed to decode Conway block hex string into CBOR bytes: %v",
40+
err,
41+
)
3942
}
4043

4144
// Deserialize CBOR bytes into ConwayBlock struct
@@ -48,15 +51,22 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) {
4851
// Re-encode using the cbor Encode function
4952
encoded, err := cbor.Encode(block)
5053
if err != nil {
51-
t.Fatalf("Failed to marshal ConwayBlock using custom encode function: %v", err)
54+
t.Fatalf(
55+
"Failed to marshal ConwayBlock using custom encode function: %v",
56+
err,
57+
)
5258
}
5359
if encoded == nil || len(encoded) == 0 {
5460
t.Fatal("Custom encoded CBOR from ConwayBlock is nil or empty")
5561
}
5662

5763
// Ensure the original and re-encoded CBOR bytes are identical
5864
if !bytes.Equal(dataBytes, encoded) {
59-
t.Errorf("Custom CBOR round-trip mismatch for Conway block\nOriginal CBOR (hex): %x\nCustom Encoded CBOR (hex): %x", dataBytes, encoded)
65+
t.Errorf(
66+
"Custom CBOR round-trip mismatch for Conway block\nOriginal CBOR (hex): %x\nCustom Encoded CBOR (hex): %x",
67+
dataBytes,
68+
encoded,
69+
)
6070

6171
// Check from which byte it differs
6272
diffIndex := -1
@@ -68,7 +78,11 @@ func TestConwayBlock_CborRoundTrip_UsingCborEncode(t *testing.T) {
6878
}
6979
if diffIndex != -1 {
7080
t.Logf("First mismatch at byte index: %d", diffIndex)
71-
t.Logf("Original byte: 0x%02x, Re-encoded byte: 0x%02x", dataBytes[diffIndex], encoded[diffIndex])
81+
t.Logf(
82+
"Original byte: 0x%02x, Re-encoded byte: 0x%02x",
83+
dataBytes[diffIndex],
84+
encoded[diffIndex],
85+
)
7286
} else {
7387
t.Logf("Length mismatch: original length = %d, re-encoded length = %d", len(dataBytes), len(encoded))
7488
}

muxer/muxer.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ type ConnectionClosedError struct {
7575
}
7676

7777
func (e *ConnectionClosedError) Error() string {
78-
return fmt.Sprintf("peer closed the connection while %s: %v", e.Context, e.Err)
78+
return fmt.Sprintf(
79+
"peer closed the connection while %s: %v",
80+
e.Context,
81+
e.Err,
82+
)
7983
}
8084

8185
func (e *ConnectionClosedError) Unwrap() error {
@@ -301,7 +305,9 @@ func (m *Muxer) readLoop() {
301305
err = io.EOF
302306
}
303307
if errors.Is(err, io.EOF) {
304-
m.sendError(&ConnectionClosedError{Context: "reading header", Err: err})
308+
m.sendError(
309+
&ConnectionClosedError{Context: "reading header", Err: err},
310+
)
305311
} else {
306312
m.sendError(err)
307313
}
@@ -318,7 +324,12 @@ func (m *Muxer) readLoop() {
318324
err = io.EOF
319325
}
320326
if errors.Is(err, io.EOF) {
321-
m.sendError(&ConnectionClosedError{Context: "reading payload", Err: err})
327+
m.sendError(
328+
&ConnectionClosedError{
329+
Context: "reading payload",
330+
Err: err,
331+
},
332+
)
322333
} else {
323334
m.sendError(err)
324335
}

protocol/txsubmission/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ func (c *Client) handleRequestTxIds(msg protocol.Message) error {
128128
return err
129129
}
130130
if !msgRequestTxIds.Blocking {
131-
return errors.New("cannot stop server process during a non-blocking operation")
131+
return errors.New(
132+
"cannot stop server process during a non-blocking operation",
133+
)
132134
}
133135
resp := NewMsgDone()
134136
if err := c.SendMessage(resp); err != nil {

0 commit comments

Comments
 (0)