func UnPinObject()

in pkg/utils/utils.go [99:117]


func UnPinObject(pinPath string) error {
	var log = logger.Get()
	found, err := IsfileExists(pinPath)
	if err != nil {
		return fmt.Errorf("unable to check file: %w", err)
	}
	if pinPath == "" || !found {
		log.Infof("PinPath is empty or file doesn't exist")
		return nil
	}

	err = os.Remove(pinPath)
	if err != nil {
		log.Infof("File remove failed ", pinPath)
		return err
	}

	return err
}