You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: generic.go
    path of file: ./repos/fyne/storage/repository
    
    the code of the file until where you have to start completion: package repository

import (
	"io"
	"strings"

	"fyne.io/fyne/v2"
)

// splitNonEmpty works exactly like strings.Split(), but only returns non-empty
// components.
func splitNonEmpty(str, sep string) []string {
	components := []string{}
	for _, v := range strings.Split(str, sep) {
		if len(v) > 0 {
			components = append(components, v)
		}
	}
	return components
}

// GenericParent can be used as a common-case implementati
    
func GenericCopy(source fyne.URI, destination fyne.URI) error {
	// Look up repositories for the source and destination.
	srcrepo, err := ForURI(source)
	if err != nil {
		return err
	}

	dstrepo, err := ForURI(destination)
	if err != nil {
		return err
	}

	// The destination must be writable.
	destwrepo, ok := dstrepo.(WritableRepository)
	if !ok {
		return ErrOperationNotSupported
	}

	// Create a reader and a writer.
	srcReader, err := srcrepo.Reader(source)
	if err != nil {
		return err
	}
	defer srcReader.Close()

	dstWriter, err := destwrepo.Writer(destination)
	if err != nil {
		return err
	}
	defer dstWriter.Close()

	// Perform the copy.
	_, err = io.Copy(dstWriter, srcReader)
	return err
}