func EqualToFile(str string, filePath string) bool {
	fileBytes, err := ioutil.ReadFile(filePath)
	if err != nil {
		panic(err)
	}
	if str != string(fileBytes) {
		return false
	}
	return true
}
Compares a string
with the contents of the
specified file.
package onyx
import (
	"io/ioutil"
	"testing"
)