From: Jeff Halter Date: Wed, 4 Aug 2021 02:24:08 +0000 (-0700) Subject: Ran `gofmt -w .` X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/5c34f8752938764668d829fb284626b9c62c5475?ds=sidebyside Ran `gofmt -w .` --- diff --git a/concat/slices.go b/concat/slices.go index daf8aae..88b9fae 100644 --- a/concat/slices.go +++ b/concat/slices.go @@ -15,4 +15,3 @@ func Slices(slices ...[]byte) []byte { return tmp } - diff --git a/hotline/access.go b/hotline/access.go index 21b438f..707dc65 100644 --- a/hotline/access.go +++ b/hotline/access.go @@ -6,7 +6,7 @@ import ( ) const ( - accessAlwaysAllow = -1 // Some transactions are always allowed + accessAlwaysAllow = -1 // Some transactions are always allowed // File System Maintenance accessDeleteFile = 0 diff --git a/hotline/client.go b/hotline/client.go index e676e65..d656db5 100644 --- a/hotline/client.go +++ b/hotline/client.go @@ -204,7 +204,7 @@ func handleTranServerMsg(c *Client, t *Transaction) (res []Transaction, err erro time := time.Now().Format(time.RFC850) msg := strings.ReplaceAll(string(t.GetField(fieldData).Data), "\r", "\n") - msg += "\n\nAt " + time + msg += "\n\nAt " + time title := fmt.Sprintf("| Private Message From: %s |", t.GetField(fieldUserName).Data) msgBox := tview.NewTextView().SetScrollable(true) @@ -226,8 +226,7 @@ func handleTranServerMsg(c *Client, t *Transaction) (res []Transaction, err erro AddItem(nil, 0, 1, false), 0, 2, true). AddItem(nil, 0, 1, false) - - c.UI.Pages.AddPage("serverMsgModal" + time, centeredFlex, true, true) + c.UI.Pages.AddPage("serverMsgModal"+time, centeredFlex, true, true) c.UI.App.Draw() // TODO: errModal doesn't render without this. wtf? return res, err diff --git a/hotline/client_conn.go b/hotline/client_conn.go index 5c25f92..eea3790 100644 --- a/hotline/client_conn.go +++ b/hotline/client_conn.go @@ -201,7 +201,7 @@ type handshake struct { // Description Size Data Note // Protocol ID 4 TRTP //Error code 4 Error code returned by the server (0 = no error) -func Handshake(conn net.Conn, buf []byte) error { +func Handshake(conn net.Conn, buf []byte) error { var h handshake r := bytes.NewReader(buf) if err := binary.Read(r, binary.BigEndian, &h); err != nil { diff --git a/hotline/client_conn_test.go b/hotline/client_conn_test.go index d18f9b6..80c22b4 100644 --- a/hotline/client_conn_test.go +++ b/hotline/client_conn_test.go @@ -50,4 +50,4 @@ func TestClientConn_handleTransaction(t *testing.T) { } }) } -} \ No newline at end of file +} diff --git a/hotline/files_test.go b/hotline/files_test.go index 88c893f..90c5f00 100644 --- a/hotline/files_test.go +++ b/hotline/files_test.go @@ -45,7 +45,7 @@ func TestEncodeFilePath(t *testing.T) { func TestCalcTotalSize(t *testing.T) { cwd, _ := os.Getwd() - defer func() {_ = os.Chdir(cwd)}() + defer func() { _ = os.Chdir(cwd) }() _ = os.Chdir("test/config/Files") diff --git a/hotline/flattened_file_object_test.go b/hotline/flattened_file_object_test.go index 6a6953f..63e7175 100644 --- a/hotline/flattened_file_object_test.go +++ b/hotline/flattened_file_object_test.go @@ -17,6 +17,7 @@ func TestReadFlattenedFileObject(t *testing.T) { t.Errorf("ReadFlattenedFileObject() = %q, want %q", format, want) } } + // //func TestNewFlattenedFileObject(t *testing.T) { // ffo := NewFlattenedFileObject("test/config/files", "testfile.txt") diff --git a/hotline/server_blackbox_test.go b/hotline/server_blackbox_test.go index 41d331b..09687ad 100644 --- a/hotline/server_blackbox_test.go +++ b/hotline/server_blackbox_test.go @@ -122,7 +122,6 @@ func TestHandshake(t *testing.T) { // } //} - func TestNewUser(t *testing.T) { srv, _, _ := StartTestServer() @@ -310,8 +309,6 @@ func TestNewUser(t *testing.T) { } } - - // equal is a utility function used only in tests that determines if transactions are equal enough func (t Transaction) equal(otherT Transaction) bool { t.ID = []byte{0, 0, 0, 0} diff --git a/hotline/server_test.go b/hotline/server_test.go index 2e88202..c69177f 100644 --- a/hotline/server_test.go +++ b/hotline/server_test.go @@ -91,7 +91,6 @@ package hotline //} // - ////func TestHandleTranAgreed(t *testing.T) { //// clients, _ := StartTestServerWithClients(2) //// diff --git a/hotline/tracker.go b/hotline/tracker.go index 69d9fd4..e06f9a8 100644 --- a/hotline/tracker.go +++ b/hotline/tracker.go @@ -110,7 +110,7 @@ func GetListing(addr string) ([]ServerRecord, error) { if readLen, err = conn.Read(buf); err != nil { return nil, err } - totalRead += readLen // 1514 + totalRead += readLen // 1514 var th TrackerHeader if err := binary.Read(bytes.NewReader(buf[:6]), binary.BigEndian, &th); err != nil { diff --git a/hotline/transaction_handlers_test.go b/hotline/transaction_handlers_test.go index 3042da2..cf05a99 100644 --- a/hotline/transaction_handlers_test.go +++ b/hotline/transaction_handlers_test.go @@ -167,7 +167,7 @@ func TestHandleLeaveChat(t *testing.T) { }, }, }, - t: NewTransaction(tranDeleteUser,nil, NewField(fieldChatID, []byte{0, 0, 0, 1})), + t: NewTransaction(tranDeleteUser, nil, NewField(fieldChatID, []byte{0, 0, 0, 1})), }, want: []Transaction{ { @@ -201,7 +201,6 @@ func TestHandleLeaveChat(t *testing.T) { } } - func TestHandleGetUserNameList(t *testing.T) { type args struct { cc *ClientConn diff --git a/hotline/transaction_test.go b/hotline/transaction_test.go index 227b9e0..4c7d372 100644 --- a/hotline/transaction_test.go +++ b/hotline/transaction_test.go @@ -151,7 +151,7 @@ func TestReadTransaction(t *testing.T) { { name: "when len(buf) is less than the length of the transaction", args: args{ - buf: sampleTransaction.Payload()[:len(sampleTransaction.Payload()) - 1], + buf: sampleTransaction.Payload()[:len(sampleTransaction.Payload())-1], }, want: nil, want1: 0, diff --git a/hotline/transfer.go b/hotline/transfer.go index ecbe324..b8bec1d 100644 --- a/hotline/transfer.go +++ b/hotline/transfer.go @@ -28,6 +28,7 @@ func NewReadTransfer(b []byte) (Transfer, error) { return transfer, nil } + // //type FolderTransfer struct { // Protocol [4]byte // "HTXF" 0x48545846 diff --git a/hotline/user_test.go b/hotline/user_test.go index 705dec0..2268a3e 100644 --- a/hotline/user_test.go +++ b/hotline/user_test.go @@ -105,7 +105,7 @@ func TestNegatedUserString(t *testing.T) { args: args{ encodedString: []byte("foo1"), }, - want: []byte{0x99, 0x90, 0x90, 0xce }, + want: []byte{0x99, 0x90, 0x90, 0xce}, }, } for _, tt := range tests {