13 lines
385 B
Go
13 lines
385 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package shared
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
// Copied from https://stackoverflow.com/a/20026945 and https://stackoverflow.com/a/49148866
|
|
// Not testable as host environment could be just about anything
|
|
// and this function is for testing the host environment
|
|
func IsWritable(path string) bool {
|
|
return unix.Access(path, unix.W_OK) == nil
|
|
}
|