func cleanupGlobal(t *testing.T) string {
	GlobalPath = "~/test-spread-global-path"
	if path, err := GlobalLocation(); err == nil {
		if err = os.RemoveAll(path); err != nil {
			t.Fatalf("could not remove global location: %v", err)
			return ""
		}
		return path
	} else {
		t.Fatalf("could not resolve global location: %v", err)
		return ""
	}
}
returns global location after cleaning up directory
package project
import (
	"os"
	"testing"
)