Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "path/filepath"
- )
- func main() {
- // Output: /path/to/dir
- fmt.Println(filepath.Dir("/path//to/dir/file.ext"))
- }
- // The `Parent` is what I want,
- // and this is a pseudo-code example, this won't actually work.
- //
- // Output: dir
- fmt.Println(filepath.Parent("/path//to/dir/file.ext"))
Add Comment
Please, Sign In to add comment