j-schwar / fpath

Simple file path manipulation in go focusing on splits.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fpath

Simple file path manipulation focusing on splits and replacements.

Installation

$ go get -u github.com/j-schwar/fpath

Examples

File Extensions

Splitting a path on its extension:

file, ext := fpath.SplitExt("foo.go")
// file -> "foo"
// ext -> "go"

Replacing the extension of a file:

objFile := fpath.ReplaceExt("foo.cpp", "o")
// objFile -> "foo.o"

Removing a file extension:

file := fpath.RemoveExt("foo.go")
// file -> "foo"

About

Simple file path manipulation in go focusing on splits.

License:MIT License


Languages

Language:Go 100.0%