Skip to content

Instantly share code, notes, and snippets.

@quoeamaster
Created September 24, 2022 01:16
Show Gist options
  • Save quoeamaster/b931a770f05f539f6ae7e8e9d9378100 to your computer and use it in GitHub Desktop.
Save quoeamaster/b931a770f05f539f6ae7e8e9d9378100 to your computer and use it in GitHub Desktop.
// create client / http-request
if response, err := http.Get(fmt.Sprintf("%v/help", pTestServer.URL)); err != nil {
t.Errorf("failed to [/help] %v", err)
} else {
bData, _ := ioutil.ReadAll(response.Body)
line := string(bData)
t.Logf("[deb] help -> %v\n", line)
if strings.Contains(line, "help is under-development") {
t.Logf("- cool~ help is NORMAL\n")
} else {
t.Errorf("- damn~ help is not achieved, %v\n", line)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment