plugin/file: allow README.md testing (#3052)

* Fix corefile usage

* plugin/file: allow README.md testing

Allow readme testing for the file plugin and fix bugs that where found:

* the reader wasn't reset when re-reading the same io.reader for a
  different origin.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Update test/example_test.go

Co-Authored-By: Michael Grosser <development@stp-ip.net>
This commit is contained in:
Miek Gieben
2019-07-27 11:47:55 +00:00
committed by GitHub
parent cfc4948f92
commit 7a3371d740
4 changed files with 18 additions and 16 deletions

View File

@@ -145,7 +145,7 @@ func Parse(f io.Reader, origin, fileName string, serial int64) (*Zone, error) {
}
}
if !seenSOA {
return nil, fmt.Errorf("file %q has no SOA record", fileName)
return nil, fmt.Errorf("file %q has no SOA record for origin %s", fileName, origin)
}
return z, nil