Skip to content

Commit

Permalink
add type assertions to gomobile/repository.go
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdaniels committed Jan 17, 2021
1 parent d95d323 commit a4aa551
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion internal/driver/gomobile/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import (
"fyne.io/fyne"
)

// declare conformance with repository types
var _ repository.Repository = (*mobileFileRepo)(nil)
var _ repository.HierarchicalRepository = (*mobileFileRepo)(nil)
var _ repository.CopyableRepository = (*mobileFileRepo)(nil)
var _ repository.MovableRepository = (*mobileFileRepo)(nil)
var _ repository.ListableRepository = (*mobileFileRepo)(nil)

// TODO add write support (not yet supported on mobile)
// var _ repository.WriteableRepository = (*mobileFileRepo)(nil)

type mobileFileRepo struct {
driver *mobileDriver
}
Expand Down Expand Up @@ -33,4 +43,7 @@ func (m *mobileFileRepo) List(u fyne.URI) ([]fyne.URI, error) {
return listURI(u)
}

// TODO add write support (not yet supported on mobile)
func (m *mobileFileRepo) CreateListable(u fyne.URI) error {
// TODO: implement this
return nil
}

0 comments on commit a4aa551

Please sign in to comment.