github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/not-internal/lockedfile/internal/filelock/filelock_other.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 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris,!windows 6 7 package filelock 8 9 import "os" 10 11 type lockType int8 12 13 const ( 14 readLock = iota + 1 15 writeLock 16 ) 17 18 func lock(f File, lt lockType) error { 19 return &os.PathError{ 20 Op: lt.String(), 21 Path: f.Name(), 22 Err: ErrNotSupported, 23 } 24 } 25 26 func unlock(f File) error { 27 return &os.PathError{ 28 Op: "Unlock", 29 Path: f.Name(), 30 Err: ErrNotSupported, 31 } 32 } 33 34 func isNotSupported(err error) bool { 35 return err == ErrNotSupported 36 }