Skip to content
forked from small-tk/pathlib

A golang path library. Salute to python pathlib.

License

Notifications You must be signed in to change notification settings

yuuki0xff/pathlib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card license

pathlib

A golang path library, it is easy to use. Similar to Python patblib.

该项目目前处于积极发展期😀,欢迎 issues

Installation

go get -u github.com/small-tk/pathlib

Enjoy

package main

import "github.com/small-tk/pathlib"

func main (){
	p := New("test.txt")

	fmt.Println(p.Absolute())
	fmt.Println(p.Cwd())
	fmt.Println(p.Parent())
	fmt.Println(p.Touch())

	fmt.Println(p.Unlink())
	fmt.Println(p.MkDir(os.ModePerm, true))
	fmt.Println(p.RmDir())
	fmt.Println(p.Open())
	fmt.Println(p.Chmod(os.ModePerm))
	fmt.Println(p.Chmod(os.ModePerm))

	fmt.Println(p.Exists())
	fmt.Println(p.IsDir())
	fmt.Println(p.IsFile())
	fmt.Println(p.IsAbs())
}

About

A golang path library. Salute to python pathlib.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%