Skip to content

Latest commit

 

History

History
33 lines (29 loc) · 673 Bytes

README.md

File metadata and controls

33 lines (29 loc) · 673 Bytes

PathBa


## Installation ```bash go get github.com/CasperHK/pathinfo ```

Usage

import {
    "github.com/CasperHK/pathinfo"
}
path := pathinfo.NewPath("/www/htdocs/inc/lib.inc.php")

fmt.Println(path.Dir())
fmt.Println(path.Base())
fmt.Println(path.Ext())
fmt.Println(path.Name())

fmt.Println(path.HasExtension())
fmt.Println(path.MoveUp(2))
fmt.Println(path.IsRelative())
fmt.Println(path.IsAbsolute())
fmt.Println(path.IsExt([]string{"php", "doc"}))
fmt.Println(path.IsNotExt([]string{"php", "doc"}))
fmt.Println(path.IsFromUnixLike())
fmt.Println(path.IsFromWindow())
fmt.Println(path.IsOnlyBaseName())
fmt.Println(path.RemoveExtension())