path

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package path 提供一些文件相关的操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(path, wd string) (p string, err error)

Abs 获取 path 的绝对路径

如果 path 是相对路径的,则将其设置为相对于 wd 的路径

func CurrPath

func CurrPath(path string) string

CurrPath 获取相当于调用者所在目录的路径列表,相当于 PHP 的 __DIR__ + "/" + path

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile 读取本地或是远程的文件内容

func Rel

func Rel(path, wd string) string

Rel 尽可能地返回 path 相对于 wd 的路径,如果不存在相对关系,则原因返回 path。

Types

This section is empty.

Jump to

Keyboard shortcuts

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