Help us shape the future of Go! Take the 2026 Go Developer Survey

extensions

command
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Extensions example shows how to restrict the picker to a set of file extensions, the way many "attach a document" dialogs only allow .pdf, .docx, .doc, and so on.

WithExtensions is opt-in: omit it and every file is shown (the default). Matching is case-insensitive, so "Report.PDF" is included by WithExtensions("pdf"). It also composes with WithFilter — a file is shown if it matches either the glob patterns or the extensions.

Usage:

go run ./examples/extensions
go run ./examples/extensions pdf docx doc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL