utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(base, path string) (string, error)

func AppendLine added in v0.3.1

func AppendLine(line, path string) error

func CommandExists

func CommandExists(cmd string) bool

コマンドの存在確認

func CommentOut

func CommentOut(path string, targetLineNo int) error

指定したファイルの指定した行の行頭に#を追加します

func Exists

func Exists(path string) bool

ファイルが存在するかどうか

func GetHomeDir

func GetHomeDir() string

func IsDir

func IsDir(path string) bool

文字列が正常なディレクトリへのパスかどうかを確認します

func IsEmpty

func IsEmpty(str string) bool

func IsFile

func IsFile(path string) bool

文字列が正常なファイルパスかどうかを調べます

func IsSymlink(path string) bool

シンボリックリンクかどうか 参考: https://github.com/eihigh/filetest Thanks eihigh <eihigh.contact@gmail.com>

func ReadLines

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

ファイルの内容を読みとって文字列配列を返します

func RemoveLine added in v0.3.0

func RemoveLine(path string, targetLineNo int) error

func ReplaceTilde added in v0.5.3

func ReplaceTilde(path string) string

~/を置き換え

func RunCmd

func RunCmd(name string, args ...string) error

func RunCmdAndGet added in v0.2.0

func RunCmdAndGet(name string, args ...string) ([]string, []string, error)

func SortWithLen

func SortWithLen(arr []string) []string

文字列配列を長さでソート

func WriteLines

func WriteLines(lines []string, path 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