github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/not-internal/lockedfile/internal/filelock/filelock_plan9.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build plan9 6 7 package filelock 8 9 import ( 10 "os" 11 ) 12 13 type lockType int8 14 15 const ( 16 readLock = iota + 1 17 writeLock 18 ) 19 20 func lock(f File, lt lockType) error { 21 return &os.PathError{ 22 Op: lt.String(), 23 Path: f.Name(), 24 Err: ErrNotSupported, 25 } 26 } 27 28 func unlock(f File) error { 29 return &os.PathError{ 30 Op: "Unlock", 31 Path: f.Name(), 32 Err: ErrNotSupported, 33 } 34 } 35 36 func isNotSupported(err error) bool { 37 return err == ErrNotSupported 38 }