Skip to content

Commit d0ee324

Browse files
committed
fix example on windows
1 parent b678606 commit d0ee324

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

example_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package fslock_test
33
import (
44
"errors"
55
"fmt"
6+
"os"
67

7-
"github.com/ipfs/go-fs-lock"
8+
fslock "github.com/ipfs/go-fs-lock"
89
)
910

1011
func ExampleLockedError() {
11-
_, err := fslock.Lock("/tmp/", "foo.lock")
12+
_, err := fslock.Lock(os.TempDir(), "foo.lock")
1213
fmt.Println("locked:", errors.As(err, new(fslock.LockedError)))
1314

14-
_, err = fslock.Lock("/tmp/", "foo.lock")
15+
_, err = fslock.Lock(os.TempDir(), "foo.lock")
1516
fmt.Println("locked:", errors.As(err, new(fslock.LockedError)))
1617
// Output:
1718
// locked: false

0 commit comments

Comments
 (0)