Popularity
1.3
Declining
Activity
0.0
Stable
13
1
3
Programming language: Go
License: MIT License
Tags:
File Handling
pathtype alternatives and similar packages
Based on the "File Handling" category.
Alternatively, view pathtype alternatives based on common mentions on social networks and blogs.
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
Promo
getstream.io

Do you think we are missing an alternative of pathtype or a related project?
Popular Comparisons
README
pathtype
Treat paths as their own type instead of using strings. This small package wraps functions from the standard library to create a new Path type.
Example
Code
package main
import (
"fmt"
"log"
pt "github.com/jonchun/pathtype"
)
type path = pt.Path
func main() {
myFile := path("myfile.txt")
exampleFile := path("example/example.txt")
fmt.Println(exampleFile.Dir())
fmt.Println(exampleFile.Dir().Join(myFile))
res, err := exampleFile.Dir().Join(myFile).Dir().Abs()
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
fmt.Println("=========================")
listBase(res)
fmt.Println("=========================")
listExt(res)
}
// list all Base for files in p
func listBase(p path) {
if glob, err := p.Glob("*"); err != nil {
log.Fatal(err)
} else {
for _, match := range glob {
fmt.Println(match.Base())
}
}
}
// list all extensions for files in p
func listExt(p path) {
if glob, err := p.Glob("*"); err != nil {
log.Fatal(err)
} else {
for _, match := range glob {
fmt.Println(match.Ext())
}
}
}
Output
example
example/myfile.txt
/home/jonchun/example_module/example
=========================
1.log
2.log
example.txt
=========================
.log
.log
.txt
See GoDoc for documentation, but it should be pretty self-explanatory.
TODO
- Update examples for all the methods and have 1-to-1 coverage of the official examples/docs.