format
This commit is contained in:
parent
8788eea4f0
commit
645f40f0c6
8 changed files with 32 additions and 37 deletions
|
|
@ -44,7 +44,7 @@ func createExerciceFile(theme fic.Theme, exercice fic.Exercice, args []string, b
|
|||
return exercice.ImportFile(pathname, uf.URI)
|
||||
}
|
||||
|
||||
func getCloudFile(pathname string, dest string) (error) {
|
||||
func getCloudFile(pathname string, dest string) error {
|
||||
client := http.Client{}
|
||||
if req, err := http.NewRequest("GET", CloudDAVBase+pathname, nil); err != nil {
|
||||
return err
|
||||
|
|
@ -58,7 +58,7 @@ func getCloudFile(pathname string, dest string) (error) {
|
|||
if fd, err := os.Create(dest); err != nil {
|
||||
return err
|
||||
} else {
|
||||
defer fd.Close();
|
||||
defer fd.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return errors.New(resp.Status)
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ var ApiThemesRouting = map[string]DispatchFunction{
|
|||
}
|
||||
|
||||
type exportedExercice struct {
|
||||
Title string `json:"title"`
|
||||
Gain int64 `json:"gain"`
|
||||
Solved int64 `json:"solved"`
|
||||
Title string `json:"title"`
|
||||
Gain int64 `json:"gain"`
|
||||
Solved int64 `json:"solved"`
|
||||
}
|
||||
|
||||
type exportedTheme struct {
|
||||
Name string `json:"name"`
|
||||
Authors string `json:"authors"`
|
||||
Name string `json:"name"`
|
||||
Authors string `json:"authors"`
|
||||
Exercices map[string]exportedExercice `json:"exercices"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"path"
|
||||
)
|
||||
|
||||
type staticRouting struct{
|
||||
type staticRouting struct {
|
||||
StaticDir string
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue