diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c80dd..84d258f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.2 + +* Updates GO (Desktop) to support multiple extension filters. + ## 1.6.1 * Addresses an issue that could result in permission handler resolving requests from other activities. diff --git a/go/file_darwin.go b/go/file_darwin.go index 4e67e4d..f8c6234 100644 --- a/go/file_darwin.go +++ b/go/file_darwin.go @@ -9,21 +9,27 @@ import ( "github.com/pkg/errors" ) -func fileFilter(method string) (string, error) { +func fileFilter(method string, extensions []string, size int) (string, error) { switch method { - case "ANY": + case "any": return `"public.item"`, nil - case "IMAGE": + case "image": return `"public.image"`, nil - case "AUDIO": + case "audio": return `"public.audio"`, nil - case "VIDEO": + case "video": return `"public.movie"`, nil - default: - if strings.HasPrefix(method, "__CUSTOM_") { - resolveType := strings.Split(method, "__CUSTOM_") - return `"` + resolveType[1] + `"`, nil + case "custom": + var i int + var filters = "" + for i = 0 ; i