Skip to content

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

License

Notifications You must be signed in to change notification settings

hlubek/readercomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages