diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-03-17 21:58:54 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-03-21 09:32:35 +0100 |
commit | 0e305d695820779a5c66fbe3434e3293911d7f98 (patch) | |
tree | af07f4be9ef8682cff914cbcf9d6e42e05c81434 /modules | |
parent | 5adb81ce39a36214712762288c6aab9ebcff5e24 (diff) | |
download | hugo-0e305d695820779a5c66fbe3434e3293911d7f98.tar.gz hugo-0e305d695820779a5c66fbe3434e3293911d7f98.zip |
all: Use strings.Cut
Updates #9687
Diffstat (limited to 'modules')
-rw-r--r-- | modules/config.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/config.go b/modules/config.go index ada39cc1f..04bf1b422 100644 --- a/modules/config.go +++ b/modules/config.go @@ -402,11 +402,8 @@ func (m Mount) Component() string { } func (m Mount) ComponentAndName() (string, string) { - k := strings.Index(m.Target, fileSeparator) - if k == -1 { - return m.Target, "" - } - return m.Target[:k], m.Target[k+1:] + c, n, _ := strings.Cut(m.Target, fileSeparator) + return c, n } func getStaticDirs(cfg config.Provider) []string { |