Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LockedError ¶ added in v0.0.2
type LockedError string
LockedError is returned as the inner error type when the lock is already taken.
Example ¶
package main import ( "errors" "fmt" "os" fslock "github.com/ipfs/go-fs-lock" ) func main() { _, err := fslock.Lock(os.TempDir(), "foo.lock") fmt.Println("locked:", errors.As(err, new(fslock.LockedError))) _, err = fslock.Lock(os.TempDir(), "foo.lock") fmt.Println("locked:", errors.As(err, new(fslock.LockedError))) }
Output: locked: false locked: true
func (LockedError) Error ¶ added in v0.0.2
func (e LockedError) Error() string
Click to show internal directories.
Click to hide internal directories.