Skip to content
/ sfp Public

A Go library that provides acccess to platform-native file pickers

License

Notifications You must be signed in to change notification settings

dylrich/sfp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System File Picker

This Go library provides access to platform-native file pickers from Go without requiring the use of C. The current implementation is very much a work in progress and should not be considered robust. The API is not yet stable, there is limited testing, and only Windows and Linux (GTK) are supported. In the future I hope to support Android, iOS, MacOS, the BSDs, and Solaris.

The API is dead simple, although users should be aware that this library is blocking - your program will halt while waiting for the selection to be made. If you'd like to make this an asynchronous process you can wrap the implementation with a goroutine as you would normally. Below is an example of usage:

package main

import (
	"fmt"
	"log"
	"github.com/dylrich/sfp"
)

func main() {
	path, err := sfp.Pick()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(path)

	paths, err := sfp.PickMultiple()
	if err != nil {
		log.Fatal(err)
	}
	for _, p := range paths {
		fmt.Println(p)
	}
}

About

A Go library that provides acccess to platform-native file pickers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages