func (s *Storage) Ls() ([]string, error) {
	files, err := ioutil.ReadDir(s.Dir)
	if err != nil {
		return nil, err
	}
	names := []string{}
	for _, file := range files {
		name := file.Name()
		if file.IsDir() {
			names = append(names, name)
		}
	}
	return names, nil
}
Ls lists all available repository names.
package storage
import (
	"github.com/libgit2/git2go"
	"io/ioutil"
	"os"
	"path"
)
type Storage struct {
	Dir string
}
func New(dir string) (*Storage, error) {
	s := &Storage{dir}
	if err := s.init(); err != nil {
		return nil, err
	}
	return s, nil
}
func (s *Storage) init() error {
	return os.MkdirAll(s.Dir, os.ModePerm)
}
func (s *Storage) GetRepo(name string) (*git.Repository, error) {
	abs := path.Join(s.Dir, name)
	return git.OpenRepository(abs)
}