func (e *Echo) run(s *http.Server, files ...string) { s.Handler = e // TODO: Remove in Go 1.6+ if e.http2 { http2.ConfigureServer(s, nil) } if len(files) == 0 { log.Fatal(s.ListenAndServe()) } else if len(files) == 2 { log.Fatal(s.ListenAndServeTLS(files[0], files[1])) } else { log.Fatal("invalid TLS configuration") } }
func GistFetch(id string) *EvalContext { client := github.NewClient(nil) gist, file, err := fetchFile(client, id, "", "eval.json") if err != nil { log.Fatal(err) } log.Info("%+v", file) v := &EvalContext{} err = json.Unmarshal([]byte(file.Content), v) log.Info("%+v\n", v) log.Info("%+v\n %+v\n %+v\n", v.Generator, v.Solution, v.Test) updateInput(client, gist, v.Generator, v.Solution, v.Test) return &EvalContext{v.Generator, v.Solution, v.Test} }