From e6d44cb2beb4acdec6c815398263ce77fa85a377 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Fri, 10 Feb 2017 14:41:15 -0700 Subject: [PATCH] commands: use TrimPrefix for clarity --- commands/command_lock.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/commands/command_lock.go b/commands/command_lock.go index 2188cc37..0a7141e7 100644 --- a/commands/command_lock.go +++ b/commands/command_lock.go @@ -72,10 +72,7 @@ func lockPath(file string) (string, error) { abs := filepath.Join(wd, file) path := strings.TrimPrefix(abs, repo) - if len(path) > 1 { - path = path[1:] - } - + path = strings.TrimPrefix(path, "/") if stat, err := os.Stat(abs); err != nil { return path, err } else {