mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
15 lines
244 B
Go
15 lines
244 B
Go
package filepathext
|
|
|
|
import (
|
|
"path/filepath"
|
|
)
|
|
|
|
// SmartJoin joins two paths, but only if the second is not already an
|
|
// absolute path.
|
|
func SmartJoin(a, b string) string {
|
|
if filepath.IsAbs(b) {
|
|
return b
|
|
}
|
|
return filepath.Join(a, b)
|
|
}
|