func (id sha1) Equal(s2 interface{}) bool {
	switch v := s2.(type) {
	case string:
		if len(v) != 40 {
			return false
		}
		return v == id.String()
	case []byte:
		if len(v) != 20 {
			return false
		}
		for i, v := range v {
			if id[i] != v {
				return false
			}
		}
	case sha1:
		for i, v := range v {
			if id[i] != v {
				return false
			}
		}
	default:
		return false
	}
	return true
}
Return true if s has the same sha1 as caller.
Support 40-length-string, []byte, sha1
package git
import (
	"encoding/hex"
	"errors"
	"fmt"
	"strings"
)
var (
	IdNotExist = errors.New("sha1 id not exist")
)
type sha1 [20]byte