Skip to content

Commit 080bf89

Browse files
committed
Some small cleanups
1 parent d1cf8d3 commit 080bf89

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

modules/lfs/filesystem_client.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
// FilesystemClient is used to read LFS data from a filesystem path
1717
type FilesystemClient struct {
18-
lfsdir string
18+
lfsDir string
1919
}
2020

2121
// BatchSize returns the preferred size of batchs to process
@@ -25,16 +25,12 @@ func (c *FilesystemClient) BatchSize() int {
2525

2626
func newFilesystemClient(endpoint *url.URL) *FilesystemClient {
2727
path, _ := util.FileURLToPath(endpoint)
28-
29-
lfsdir := filepath.Join(path, "lfs", "objects")
30-
31-
client := &FilesystemClient{lfsdir}
32-
33-
return client
28+
lfsDir := filepath.Join(path, "lfs", "objects")
29+
return &FilesystemClient{lfsDir}
3430
}
3531

3632
func (c *FilesystemClient) objectPath(oid string) string {
37-
return filepath.Join(c.lfsdir, oid[0:2], oid[2:4], oid)
33+
return filepath.Join(c.lfsDir, oid[0:2], oid[2:4], oid)
3834
}
3935

4036
// Download reads the specific LFS object from the target path

modules/util/path.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ func isOSWindows() bool {
225225
var driveLetterRegexp = regexp.MustCompile("/[A-Za-z]:/")
226226

227227
// FileURLToPath extracts the path information from a file://... url.
228+
// It returns an error only if the URL is not a file URL.
228229
func FileURLToPath(u *url.URL) (string, error) {
229230
if u.Scheme != "file" {
230231
return "", errors.New("URL scheme is not 'file': " + u.String())

0 commit comments

Comments
 (0)