diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-23 18:46:32 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-23 18:46:32 +0100 |
commit | a721fbed1daf5f9046ceff5f831f9a859347bd90 (patch) | |
tree | 72ba89833062a3db2b86168758052ffe9883ce60 | |
parent | 3739871f1e9fa1edffe80fea289dde33388949b4 (diff) |
target: Simplify
-rw-r--r-- | target/htmlredirect.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/target/htmlredirect.go b/target/htmlredirect.go index 20e064c88..81a15fa73 100644 --- a/target/htmlredirect.go +++ b/target/htmlredirect.go @@ -104,9 +104,7 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error } // Add the final touch - if strings.HasPrefix(alias, helpers.FilePathSeparator) { - alias = alias[1:] - } + alias = strings.TrimPrefix(alias, helpers.FilePathSeparator) if strings.HasSuffix(alias, helpers.FilePathSeparator) { alias = alias + "index.html" } else if !strings.HasSuffix(alias, ".html") { |