util

package
v0.0.0-...-c68081f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFiles

func GetFiles(dir string, ignoreHiddenDir bool, ignoreDotGit bool) ([]string, error)

指定したディレクトリ以下のファイルを再帰的に取得する. ignoreHiddenDirがtrueの場合、隠しディレクトリは無視する. ignoreDotGitがtrueの場合、.gitディレクトリは無視する. これはignoreHiddenDirでも無視される、内容のため、falseの場合のみ効果がある

func OpenURL

func OpenURL(url string) error

URLを規定ブラウザで開く. Linuxの場合、xdg-openコマンドを使用する. GUI環境である必要がある

func SortByPathDepth

func SortByPathDepth(paths []string) []string

パスの深さでソートする

Types

type ZipFileBuilder

type ZipFileBuilder struct {
	// contains filtered or unexported fields
}

zipファイルを作成するビルダー

func NewZipFileBuilder

func NewZipFileBuilder() *ZipFileBuilder

func (*ZipFileBuilder) AddFile

func (b *ZipFileBuilder) AddFile(name string, realPath string)

ファイルを追加する name: zipに含めるファイル名. / で区切るとディレクトリを作成できる realPath: 実際のファイルパス

func (*ZipFileBuilder) Create

func (b *ZipFileBuilder) Create(dst string) error

指定の場所にzipファイルを作成する

func (*ZipFileBuilder) String

func (b *ZipFileBuilder) String() string

filesの内容を文字列で返す

Jump to

Keyboard shortcuts

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