Skip to content

Commit

Permalink
Added sample program
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Kowalczyk committed Feb 18, 2021
1 parent 7fd0e7c commit 5b05f3d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,29 @@ Examples of usage:
- `FileDirectory: /Users/user/directory`
- `FileBase: foo.txt`
- `FileName: foo`
- `FileExtension: txt`
- `FileExtension: txt`

````
// Sample program
package main
import (
"fmt"
"github.com/marekkowalczyk/filenames"
)
func main() {
filepath := "/Users/user/directory/foo.txt"
fmt.Println("FilePath:\t", filepath)
fmt.Println("FileDirectory:\t", filenames.FileDirectory(filepath))
fmt.Println("FileBase:\t", filenames.FileBase(filepath))
fmt.Println("FileName:\t", filenames.FileName(filepath))
fmt.Println("FileExtension:\t", filenames.FileExtension(filepath))
}
````

0 comments on commit 5b05f3d

Please sign in to comment.