]> git.r.bdr.sh - rbdr/mobius/commitdiff
Ran `gofmt -w .`
authorJeff Halter <redacted>
Wed, 4 Aug 2021 02:24:08 +0000 (19:24 -0700)
committerJeff Halter <redacted>
Tue, 3 Aug 2021 21:24:08 +0000 (14:24 -0700)
14 files changed:
concat/slices.go
hotline/access.go
hotline/client.go
hotline/client_conn.go
hotline/client_conn_test.go
hotline/files_test.go
hotline/flattened_file_object_test.go
hotline/server_blackbox_test.go
hotline/server_test.go
hotline/tracker.go
hotline/transaction_handlers_test.go
hotline/transaction_test.go
hotline/transfer.go
hotline/user_test.go

index daf8aae49105cc06cd806d93e55ec40a53afeeef..88b9faed8afd2dce85494c5efe104f668e1cb724 100644 (file)
@@ -15,4 +15,3 @@ func Slices(slices ...[]byte) []byte {
 
        return tmp
 }
 
        return tmp
 }
-
index 21b438f79e29cfe1f0e8516a447e82af8a07d2b9..707dc6561eafa9285eb5d7ee61def7b690ec1d54 100644 (file)
@@ -6,7 +6,7 @@ import (
 )
 
 const (
 )
 
 const (
-       accessAlwaysAllow      = -1 // Some transactions are always allowed
+       accessAlwaysAllow = -1 // Some transactions are always allowed
 
        // File System Maintenance
        accessDeleteFile   = 0
 
        // File System Maintenance
        accessDeleteFile   = 0
index e676e65b73d084b5cb1977d8231eb804f6f71ec9..d656db5eb73910c1962af7af6d854533e1955a4c 100644 (file)
@@ -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")
        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)
        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)
 
                        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
        c.UI.App.Draw() // TODO: errModal doesn't render without this.  wtf?
 
        return res, err
index 5c25f928860348d66814f60f63f2f46fc8e5fef1..eea3790346d659d74b21e57e63197414020ef2b2 100644 (file)
@@ -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)
 // 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 {
        var h handshake
        r := bytes.NewReader(buf)
        if err := binary.Read(r, binary.BigEndian, &h); err != nil {
index d18f9b603fa2fbfd0f929248e717e9b58b17dd23..80c22b471edb7abc993d80a203aaf87bfcefc5b8 100644 (file)
@@ -50,4 +50,4 @@ func TestClientConn_handleTransaction(t *testing.T) {
                        }
                })
        }
                        }
                })
        }
-}
\ No newline at end of file
+}
index 88c893f898d68b532b28d96a4f5ba1be14f964ae..90c5f0088d519ed385fc2625a49f85655f614951 100644 (file)
@@ -45,7 +45,7 @@ func TestEncodeFilePath(t *testing.T) {
 
 func TestCalcTotalSize(t *testing.T) {
        cwd, _ := os.Getwd()
 
 func TestCalcTotalSize(t *testing.T) {
        cwd, _ := os.Getwd()
-       defer func() {_ = os.Chdir(cwd)}()
+       defer func() { _ = os.Chdir(cwd) }()
 
        _ = os.Chdir("test/config/Files")
 
 
        _ = os.Chdir("test/config/Files")
 
index 6a6953f8f5ef001af68407f4fdca2aa8953ec4cb..63e71757ea01c427e806e8eae3e10b7720c61b14 100644 (file)
@@ -17,6 +17,7 @@ func TestReadFlattenedFileObject(t *testing.T) {
                t.Errorf("ReadFlattenedFileObject() = %q, want %q", format, want)
        }
 }
                t.Errorf("ReadFlattenedFileObject() = %q, want %q", format, want)
        }
 }
+
 //
 //func TestNewFlattenedFileObject(t *testing.T) {
 //     ffo := NewFlattenedFileObject("test/config/files", "testfile.txt")
 //
 //func TestNewFlattenedFileObject(t *testing.T) {
 //     ffo := NewFlattenedFileObject("test/config/files", "testfile.txt")
index 41d331b34c13ccd70eb6dcc2293e9cc5423ab9e2..09687add34f869f5f5a347946a3c8dd6161c9ba5 100644 (file)
@@ -122,7 +122,6 @@ func TestHandshake(t *testing.T) {
 //     }
 //}
 
 //     }
 //}
 
-
 func TestNewUser(t *testing.T) {
        srv, _, _ := StartTestServer()
 
 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}
 // 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}
index 2e88202dd73ce34bab74aba9d0235f3689f12541..c69177f91d4ef4ceeccdf16c8befa6ddf8652a48 100644 (file)
@@ -91,7 +91,6 @@ package hotline
 //}
 //
 
 //}
 //
 
-
 ////func TestHandleTranAgreed(t *testing.T) {
 ////   clients, _ := StartTestServerWithClients(2)
 ////
 ////func TestHandleTranAgreed(t *testing.T) {
 ////   clients, _ := StartTestServerWithClients(2)
 ////
index 69d9fd48aa95b00c56ae46d29867c55ed25f3d80..e06f9a8ad10f55330773271c7613745ed163bb4c 100644 (file)
@@ -110,7 +110,7 @@ func GetListing(addr string) ([]ServerRecord, error) {
        if readLen, err = conn.Read(buf); err != nil {
                return nil, err
        }
        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 {
 
        var th TrackerHeader
        if err := binary.Read(bytes.NewReader(buf[:6]), binary.BigEndian, &th); err != nil {
index 3042da2c6fb2013cf1c18c58fca5f9b1b4127119..cf05a99f36af0d5e86d93f05a97ba5cc4524877f 100644 (file)
@@ -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{
                                {
                        },
                        want: []Transaction{
                                {
@@ -201,7 +201,6 @@ func TestHandleLeaveChat(t *testing.T) {
        }
 }
 
        }
 }
 
-
 func TestHandleGetUserNameList(t *testing.T) {
        type args struct {
                cc *ClientConn
 func TestHandleGetUserNameList(t *testing.T) {
        type args struct {
                cc *ClientConn
index 227b9e0efe7a40583d8db495d10a22e8352c45d7..4c7d3725168b54f9c39719158fc53e8a5490da7e 100644 (file)
@@ -151,7 +151,7 @@ func TestReadTransaction(t *testing.T) {
                {
                        name: "when len(buf) is less than the length of the transaction",
                        args: args{
                {
                        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,
                        },
                        want:    nil,
                        want1:   0,
index ecbe32436d4ea40f821ad3b64679876a05f3cd7b..b8bec1dd9122b40540f48ac033c0c026c0e830b6 100644 (file)
@@ -28,6 +28,7 @@ func NewReadTransfer(b []byte) (Transfer, error) {
 
        return transfer, nil
 }
 
        return transfer, nil
 }
+
 //
 //type FolderTransfer struct {
 //     Protocol        [4]byte // "HTXF" 0x48545846
 //
 //type FolderTransfer struct {
 //     Protocol        [4]byte // "HTXF" 0x48545846
index 705dec0417bf125fff0c81a20d68a72302a050bc..2268a3ec647c4f16aa68df942206932cf19687f8 100644 (file)
@@ -105,7 +105,7 @@ func TestNegatedUserString(t *testing.T) {
                        args: args{
                                encodedString: []byte("foo1"),
                        },
                        args: args{
                                encodedString: []byte("foo1"),
                        },
-                       want: []byte{0x99, 0x90, 0x90, 0xce },
+                       want: []byte{0x99, 0x90, 0x90, 0xce},
                },
        }
        for _, tt := range tests {
                },
        }
        for _, tt := range tests {