1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

progress on refactor

This commit is contained in:
Jesse Duffield
2018-08-13 20:26:02 +10:00
parent f9c39ad64b
commit 97cff65612
23 changed files with 1104 additions and 1086 deletions

View File

@ -54,3 +54,12 @@ func GetCurrentProject() string {
}
return filepath.Base(pwd)
}
// TrimTrailingNewline - Trims the trailing newline
// TODO: replace with `chomp` after refactor
func TrimTrailingNewline(str string) string {
if strings.HasSuffix(str, "\n") {
return str[:len(str)-1]
}
return str
}