diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-15 11:13:16 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-15 11:13:16 -0700 |
| commit | 95159e5585762c06c654945070ba54262b7dcec9 (patch) | |
| tree | 23609018c1460b056ce22067290ea12ee851d483 /hotline/file_name_with_info.go | |
| parent | a6216dd89252fa01dc176f98f1e4ecfd3f637566 (diff) | |
Refactoring and cleanup
* Split CLI client into separate project
* Convert more functions to follow common Golang idioms e.g io.Reader, io.Writer
* Use ldflags for versioning
* Misc cleanup and simplification
Diffstat (limited to 'hotline/file_name_with_info.go')
| -rw-r--r-- | hotline/file_name_with_info.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hotline/file_name_with_info.go b/hotline/file_name_with_info.go index ac64c74..4d59dd0 100644 --- a/hotline/file_name_with_info.go +++ b/hotline/file_name_with_info.go @@ -9,7 +9,7 @@ import ( type FileNameWithInfo struct { fileNameWithInfoHeader - name []byte // File name + Name []byte // File Name } // fileNameWithInfoHeader contains the fixed length fields of FileNameWithInfo @@ -19,7 +19,7 @@ type fileNameWithInfoHeader struct { FileSize [4]byte // File Size in bytes RSVD [4]byte NameScript [2]byte // ?? - NameSize [2]byte // Length of name field + NameSize [2]byte // Length of Name field } func (f *fileNameWithInfoHeader) nameLen() int { @@ -36,7 +36,7 @@ func (f *FileNameWithInfo) Read(b []byte) (int, error) { f.RSVD[:], f.NameScript[:], f.NameSize[:], - f.name, + f.Name, ), ), io.EOF } @@ -47,7 +47,7 @@ func (f *FileNameWithInfo) Write(p []byte) (int, error) { return 0, err } headerLen := binary.Size(f.fileNameWithInfoHeader) - f.name = p[headerLen : headerLen+f.nameLen()] + f.Name = p[headerLen : headerLen+f.nameLen()] return len(p), nil } |