]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/lockedfile/internal/filelock: re-use filelock_other.go for plan9
authorTobias Klauser <tklauser@distanz.ch>
Thu, 16 Mar 2023 12:12:10 +0000 (13:12 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 16 Mar 2023 17:44:12 +0000 (17:44 +0000)
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>
src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go
src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go [deleted file]

index c18dbdf8503ad1df507ff7c11e98e47e3520cbc2..7bdd62bd9b439e6ceef26274bda8befaf053532f 100644 (file)
@@ -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 (file)
index 54b2c94..0000000
+++ /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
-}