github.com/rogpeppe/go-internal@v1.12.1-0.20240509064211-c8567cf8e95f/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  //go:build !unix && !windows
     6  
     7  package filelock
     8  
     9  import "io/fs"
    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 &fs.PathError{
    20  		Op:   lt.String(),
    21  		Path: f.Name(),
    22  		Err:  ErrNotSupported,
    23  	}
    24  }
    25  
    26  func unlock(f File) error {
    27  	return &fs.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  }