Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶ added in v1.1.2
FileExists check if the file with the given path exits.
Types ¶
type LockedError ¶
type LockedError string
LockedError is returned as the inner error type when the lock is already taken.
Example ¶
fs := afero.NewMemMapFs() tmpDir, err := afero.TempDir(fs, "", "") if err != nil { panic(err) } _, err = Lock(fs, tmpDir, "foo.lock") fmt.Println("locked:", errors.As(err, new(LockedError))) _, err = Lock(fs, tmpDir, "foo.lock") fmt.Println("locked:", errors.As(err, new(LockedError)))
Output: locked: false locked: true
func (LockedError) Error ¶
func (e LockedError) Error() string
Click to show internal directories.
Click to hide internal directories.