Add handling of comments in targets.txt
Skips lines that start with `//`, to allow commments in `targets.txt`. This is handy when you want to attach a comment on why a specific endpoint is tested, in a `targets.txt` used as part of a benchmark suite.
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestReadTargets(t *testing.T) {
|
||||
lines := bytes.NewBufferString("GET http://lolcathost:9999/\n\nHEAD http://lolcathost:9999/\n")
|
||||
lines := bytes.NewBufferString("GET http://lolcathost:9999/\n\n // HEAD http://lolcathost.com this is a comment \nHEAD http://lolcathost:9999/\n")
|
||||
targets, err := readTargets(lines)
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't parse valid source: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user