This commit is contained in:
nemunaire 2016-01-23 13:19:28 +01:00
commit 645f40f0c6
8 changed files with 32 additions and 37 deletions

View file

@ -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)

View file

@ -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"`
}

View file

@ -5,7 +5,7 @@ import (
"path"
)
type staticRouting struct{
type staticRouting struct {
StaticDir string
}