pathx

package module
v0.0.0-...-55ec346 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 3 Imported by: 2

README

Pathx GoDoc Coverage Status Build Status Go Report Card

路徑輔助套件。

這是什麼?

Pathx 是用以處理與路徑相關的 Golang 套件,多數功能基於原生的 path/filepath 套件。

安裝方式

打開終端機並且透過 go get 安裝此套件即可。

$ go get github.com/teacat/pathx

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(path string, subpath string) bool

Contains 表示路徑中是否有包含指定路徑。

func Executable

func Executable() string

Executable 能夠取得執行檔案的路徑位置。

func ExecutableDir

func ExecutableDir() string

ExecutableDir 能夠取得執行檔案父資料夾的路徑位置。

func Exists

func Exists(path string) bool

Exists 會回傳一個指定路徑是否存在。

func Ext

func Ext(path string) string

Ext 能夠取得路徑中最後的檔案副檔名(無起始 `.` 符號)。

func Getwd

func Getwd() string

Getwd 能夠取得目前的目錄路徑。

func Join

func Join(paths ...string) string

Join 會將多個路徑彙整成一個。

func JoinDir

func JoinDir(paths ...string) string

JoinDir 會將多個路徑彙整乘一個並且在結尾增加目錄符號。

func Name

func Name(path string) string

Name 能夠取得路徑中最後的檔案名稱。

func Path

func Path(path string) string

Path 能夠移除單個路徑中多餘的符號,並且確保結尾沒有目錄符號。

func PathDir

func PathDir(path string) string

PathDir 能夠移除單個路徑中多餘的符號,並且確保結尾有目錄符號。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL