aboutsummaryrefslogtreecommitdiff
path: root/hotline
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-19 16:50:28 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-19 16:50:28 -0700
commit9f89cd9fbbcec9f7f42c87ee0adc21427aab9f1c (patch)
tree35d0a6a1c7c3f875858dca98095adecade289975 /hotline
parent50c837fe10df05b9cc08decb1add122fb935e8fa (diff)
Appease linter
Diffstat (limited to 'hotline')
-rw-r--r--hotline/field_test.go2
-rw-r--r--hotline/file_resume_data.go2
-rw-r--r--hotline/file_transfer.go15
-rw-r--r--hotline/message_board_test.go25
4 files changed, 10 insertions, 34 deletions
diff --git a/hotline/field_test.go b/hotline/field_test.go
index fc11c74..213d9c3 100644
--- a/hotline/field_test.go
+++ b/hotline/field_test.go
@@ -222,7 +222,7 @@ func TestField_DecodeInt(t *testing.T) {
Data: tt.fields.Data,
}
got, err := f.DecodeInt()
- if !tt.wantErr(t, err, fmt.Sprintf("DecodeInt()")) {
+ if !tt.wantErr(t, err) {
return
}
assert.Equalf(t, tt.want, got, "DecodeInt()")
diff --git a/hotline/file_resume_data.go b/hotline/file_resume_data.go
index b5d980e..5dfd2d8 100644
--- a/hotline/file_resume_data.go
+++ b/hotline/file_resume_data.go
@@ -13,7 +13,7 @@ type FileResumeData struct {
ForkCount [2]byte // Length of ForkInfoList. Either 2 or 3 depending on whether file has a resource fork
ForkInfoList []ForkInfoList
- readOffset int
+ //readOffset int // TODO
}
type ForkInfoList struct {
diff --git a/hotline/file_transfer.go b/hotline/file_transfer.go
index e37295a..806466b 100644
--- a/hotline/file_transfer.go
+++ b/hotline/file_transfer.go
@@ -289,14 +289,15 @@ func DownloadHandler(w io.Writer, fullPath string, fileTransfer *FileTransfer, f
}
}
- rFile, err := fw.rsrcForkFile()
- if err != nil {
- // return fmt.Errorf("open resource fork file: %v", err)
- }
+ rFile, _ := fw.rsrcForkFile()
+ //if err != nil {
+ // // return fmt.Errorf("open resource fork file: %v", err)
+ //}
- if _, err = io.Copy(w, io.TeeReader(rFile, fileTransfer.bytesSentCounter)); err != nil {
- // return fmt.Errorf("send resource fork data: %v", err)
- }
+ _, _ = io.Copy(w, io.TeeReader(rFile, fileTransfer.bytesSentCounter))
+ //if err != nil {
+ // // return fmt.Errorf("send resource fork data: %v", err)
+ //}
return nil
}
diff --git a/hotline/message_board_test.go b/hotline/message_board_test.go
deleted file mode 100644
index 64db714..0000000
--- a/hotline/message_board_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package hotline
-
-import "github.com/stretchr/testify/mock"
-
-type mockReadWriteSeeker struct {
- mock.Mock
-}
-
-func (m *mockReadWriteSeeker) Read(p []byte) (int, error) {
- args := m.Called(p)
-
- return args.Int(0), args.Error(1)
-}
-
-func (m *mockReadWriteSeeker) Write(p []byte) (int, error) {
- args := m.Called(p)
-
- return args.Int(0), args.Error(1)
-}
-
-func (m *mockReadWriteSeeker) Seek(offset int64, whence int) (int64, error) {
- args := m.Called(offset, whence)
-
- return args.Get(0).(int64), args.Error(1)
-}