Skip to content

Commit

Permalink
Make some more functions lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
vansante committed Sep 7, 2023
1 parent 79bdc24 commit d818afd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion concurrent_readseeker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type concurrentReadSeeker struct {
mu sync.Mutex
}

func (rs *concurrentReadSeeker) New() io.ReadSeeker {
func (rs *concurrentReadSeeker) newReadSeeker() io.ReadSeeker {
return &readSeeker{
parent: rs,
}
Expand Down
2 changes: 1 addition & 1 deletion concurrent_writeseeker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type concurrentWriteSeeker struct {
mu sync.Mutex
}

func (rs *concurrentWriteSeeker) New() io.WriteSeeker {
func (rs *concurrentWriteSeeker) newWriteSeeker() io.WriteSeeker {
return &writeSeeker{
parent: rs,
}
Expand Down
6 changes: 3 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (fs *FileServer) handleReadFile(resp http.ResponseWriter, req *http.Request
if fs.allowFullGET && req.Header.Get(HeaderRange) == "" {
// If the special range header is not set, treat it like a normal GET request
// Serve the file with the Go http handler to support partial requests
http.ServeContent(resp, req, string(fileID), time.Now(), reader.New())
http.ServeContent(resp, req, string(fileID), time.Now(), reader.newReadSeeker())
return
}

Expand All @@ -350,7 +350,7 @@ func (fs *FileServer) handleReadFile(resp http.ResponseWriter, req *http.Request

resp.WriteHeader(http.StatusPartialContent)

rdr := reader.New()
rdr := reader.newReadSeeker()
_, err := rdr.Seek(offset, io.SeekStart)
if err != nil {
fs.logger.Error("networkfile.FileServer.handleReadFile: Error seeking to offset",
Expand Down Expand Up @@ -385,7 +385,7 @@ func (fs *FileServer) handleWriteFile(resp http.ResponseWriter, req *http.Reques
return
}

wrtr := writer.New()
wrtr := writer.newWriteSeeker()
fs.logger.Debug("networkfile.FileServer.handleWriteFile: Seeking", "offset", offset)
_, err := wrtr.Seek(offset, io.SeekStart)
if err != nil {
Expand Down

0 comments on commit d818afd

Please sign in to comment.