os

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

判断所给路径文件/文件夹是否存在

func GetGoModRootDir

func GetGoModRootDir(curDir string) (string, error)

获取 go mod 项目的根目录, 从当前目录依次上下查找,知道找到当前目录中存在 go.mod 文件的目录,即根目录

func GetParentDir

func GetParentDir(dirctory string) string

获取上一级目录

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func ReadLines

func ReadLines(path string) ([]string, error)

按行读取文本文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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