func (bf *File) Reload(bad BadLineHandler) error {
	f, err := os.Open(bf.filePath)
	if err != nil {
		return err
	}
	defer f.Close()
	return bf.ReloadFromReader(f, bad)
}
Reload rereads the htpassword file..
You will need to call this to notice any changes to the password file.
This function is thread safe. Someone versed in fsnotify might make it
happen automatically. Likewise you might also connect a SIGHUP handler to
this function.
package htpasswd
import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
	"sync"
)
type EncodedPasswd interface {
	MatchesPassword(pw string) bool
}
type PasswdParser func(pw string) (EncodedPasswd, error)
type passwdTable map[string]EncodedPasswd
type BadLineHandler func(err error)
type File struct {
	filePath string
	mutex    sync.Mutex
	passwds  passwdTable
	parsers  []PasswdParser
}
var DefaultSystems = []PasswdParser{AcceptMd5, AcceptSha, AcceptBcrypt, AcceptSsha, AcceptCryptSha, AcceptPlain}
func New(filename string, parsers []PasswdParser, bad BadLineHandler) (*File, error) {
	bf := File{
		filePath: filename,
		parsers:  parsers,
	}
	if err := bf.Reload(bad); err != nil {
		return nil, err
	}
	return &bf, nil
}
func NewFromReader(r io.Reader, parsers []PasswdParser, bad BadLineHandler) (*File, error) {
	bf := File{
		parsers: parsers,
	}
	if err := bf.ReloadFromReader(r, bad); err != nil {
		return nil, err
	}
	return &bf, nil
}
func (bf *File) Match(username, password string) bool {
	bf.mutex.Lock()
	matcher, ok := bf.passwds[username]
	bf.mutex.Unlock()
	if ok && matcher.MatchesPassword(password) {
		return true
	}
	return false
}