From faad1a93bf0cbadc06f245a46d1057ced4f3710c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 2 Jan 2015 22:01:39 -0500 Subject: utils.go: Trim trailing newline on repo directory The repository directory location string had a trailing newline at the end which I don't want because this is going to be the key of a hash, so it doesn't make sense to have it. --- utils/utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index 79b2ca2..0c7760e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -52,7 +52,11 @@ func currentGitDir() string { if err := cmd.Run(); err != nil { panic(err) } - return git_directory.String() + + dir_trimmed := git_directory.String() + + // Trim newline at the end of the directory string + return dir_trimmed[:len(dir_trimmed) - 1] } return "" -- cgit v1.2.3