get cp paste file upload gogo via multipart form

This commit is contained in:
Bel LaPointe
2022-02-08 14:56:08 -07:00
parent 34b964e0bb
commit f24a8c2907
5 changed files with 99 additions and 16 deletions

View File

@@ -20,12 +20,28 @@ type Branch struct {
PID string
}
type Pretty struct {
Title string
Children map[string]Pretty
}
func NewTree(path string) *Tree {
return &Tree{
path: path,
}
}
func (tree *Tree) GetPretty() (map[string]Pretty, error) {
branches, err := tree.Get()
if err != nil {
return nil, err
}
_ = branches
pretty := map[string]Pretty{}
// TODO: rm del
return pretty, errors.New("not impl")
}
func (tree *Tree) Get() (map[string]Branch, error) {
b, err := ioutil.ReadFile(tree.path)
if os.IsNotExist(err) {