Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.26 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.26 KB

readercomp : Go package for comparing two finite io.Reader (e.g. files)

GoDoc Build Status Coverage Status Go Report Card

Why?

Comparing files (or more generally two finite io.Reader) is not as easy due to edge-cases like short reads and how errors (including EOF) are returned by calls to Read according to the interface specification.

This packages (tries) to deliver a solid implementation for these cases.

Install

go get github.com/hlubek/readercomp

Example

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/hlubek/readercomp"
)

func main() {
	result, err := readercomp.FilesEqual(os.Args[1], os.Args[2])
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(result)
}

License

MIT.