Skip to content

Commit

Permalink
cleaned up unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
willfairwinds committed Jul 25, 2019
1 parent 7b8b5fe commit e01c392
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,18 @@ func TestConfigFromURL(t *testing.T) {
})

go func() {
// returns ErrServerClosed on graceful close
if err := srv.ListenAndServe(); err != http.ErrServerClosed {
// NOTE: there is a chance that next line won't have time to run,
// as main() doesn't wait for this goroutine to stop. don't use
// code with race conditions like these for production. see post
// comments below on more discussion on how to handle this.
log.Fatalf("ListenAndServe(): %s", err)
}
}()

parsedConf, err = ParseFile("http://localhost:8081/exampleURL")
assert.NoError(t, err, "Expected no error when parsing YAML from URL")
if err := srv.Shutdown(context.TODO()); err != nil {
panic(err) // failure/timeout shutting down the server gracefully
panic(err)
}
testParsedConfig(t, &parsedConf)

//http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// fmt.Fprintf(w, resourceConfYAML1, html.EscapeString(r.URL.Path))
//})
//log.Fatal(http.ListenAndServe(":8081", nil))
}

func testParsedConfig(t *testing.T, config *Configuration) {
Expand Down

0 comments on commit e01c392

Please sign in to comment.