get cp paste file upload gogo via multipart form
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user