Join parts of a directory or filepath
- Join
package main
import (
"fmt"
"path/filepath"
)
func main() {
path := filepath.Join("main", "sub", "other") // main/sub/other main\sub\other
fmt.Println(path)
}
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
package main
import (
"fmt"
"path/filepath"
)
func main() {
path := filepath.Join("main", "sub", "other") // main/sub/other main\sub\other
fmt.Println(path)
}