1
mirror of https://github.com/rclone/rclone synced 2024-12-19 09:05:56 +01:00
rclone/cmd/cmount/mountpoint_other.go
Nick Craig-Wood e43b5ce5e5 Remove github.com/pkg/errors and replace with std library version
This is possible now that we no longer support go1.12 and brings
rclone into line with standard practices in the Go world.

This also removes errors.New and errors.Errorf from lib/errors and
prefers the stdlib errors package over lib/errors.
2021-11-07 11:53:30 +00:00

24 lines
471 B
Go

//go:build cmount && cgo && !windows
// +build cmount,cgo,!windows
package cmount
import (
"errors"
"fmt"
"os"
"github.com/rclone/rclone/cmd/mountlib"
)
func getMountpoint(mountPath string, opt *mountlib.Options) (string, error) {
fi, err := os.Stat(mountPath)
if err != nil {
return "", fmt.Errorf("failed to retrieve mount path information: %w", err)
}
if !fi.IsDir() {
return "", errors.New("mount path is not a directory")
}
return mountPath, nil
}