diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2023-03-16 13:12:10 +0100 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2023-03-16 17:44:12 +0000 |
| commit | ab28b834c4a38bd2295ee43eca4f9e38c28d54a2 (patch) | |
| tree | d54ddc113d527b219a2d23bcc9d958800533c1cf | |
| parent | 75c2e97c3c11050847fc221480e1939f29c911e5 (diff) | |
| download | go-git-ab28b834c4a38bd2295ee43eca4f9e38c28d54a2.tar.gz | |
cmd/go/internal/lockedfile/internal/filelock: re-use filelock_other.go for plan9
The implementation for lockType, lock, unlock and isNotSupported is the
same on plan9 as on other platforms where filelocks are unsupported.
Change-Id: I8b9c0bdc429e23346ab9145ec3814622319427fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/476915
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
| -rw-r--r-- | src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go | 2 | ||||
| -rw-r--r-- | src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go | 36 |
2 files changed, 1 insertions, 37 deletions
diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go index c18dbdf850..7bdd62bd9b 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !unix && !plan9 && !windows +//go:build !unix && !windows package filelock diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go deleted file mode 100644 index 54b2c946e0..0000000000 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build plan9 - -package filelock - -import "io/fs" - -type lockType int8 - -const ( - readLock = iota + 1 - writeLock -) - -func lock(f File, lt lockType) error { - return &fs.PathError{ - Op: lt.String(), - Path: f.Name(), - Err: ErrNotSupported, - } -} - -func unlock(f File) error { - return &fs.PathError{ - Op: "Unlock", - Path: f.Name(), - Err: ErrNotSupported, - } -} - -func isNotSupported(err error) bool { - return err == ErrNotSupported -} |
