diff --git a/config/file.go b/config/file.go index da1d647..abd3232 100644 --- a/config/file.go +++ b/config/file.go @@ -13,6 +13,8 @@ type line any type comment string type entry struct { key string; value Value } +var _ io.WriterTo = new(File) + // File represents a config file. It preserves the order of the lines, as well // as blank lines and comments. type File struct { @@ -251,8 +253,8 @@ func (this *File) Diff (other *File) map[string] struct { } { } // WriteTo writes the data in this file to an io.Writer. -func (file *File) WriteTo (writer io.Writer) (n int64, err error) { - for _, lin := range file.lines { +func (this *File) WriteTo (writer io.Writer) (n int64, err error) { + for _, lin := range this.lines { nint := 0 switch lin := lin.(type) { case comment: