git » spf » commit e0c6b61

Un-export DualMasks

author Alberto Bertogli
2019-10-18 19:20:46 UTC
committer Alberto Bertogli
2019-10-18 19:20:46 UTC
parent c7ba9eb89cba5a2f19642442923192091b4e5d4c

Un-export DualMasks

The DualMasks type is internal and shouldn't be exported, it was an
oversight in the previous commits.

Un-exporting it shouldn't break anything since the type is totally
opaque and not practically usable by external users.

spf.go +4 -4

diff --git a/spf.go b/spf.go
index c071b62..931c38f 100644
--- a/spf.go
+++ b/spf.go
@@ -473,12 +473,12 @@ func (r *resolution) includeField(res Result, field, domain string) (bool, Resul
 	return false, "", fmt.Errorf("This should never be reached")
 }
 
-type DualMasks struct {
+type dualMasks struct {
 	v4 int
 	v6 int
 }
 
-func ipMatch(ip, tomatch net.IP, masks DualMasks) (bool, error) {
+func ipMatch(ip, tomatch net.IP, masks dualMasks) (bool, error) {
 	mask := -1
 	if tomatch.To4() != nil && masks.v4 >= 0 {
 		mask = masks.v4
@@ -504,8 +504,8 @@ func ipMatch(ip, tomatch net.IP, masks DualMasks) (bool, error) {
 var aRegexp = regexp.MustCompile(`^[aA](:([^/]+))?(/(\w+))?(//(\w+))?$`)
 var mxRegexp = regexp.MustCompile(`^[mM][xX](:([^/]+))?(/(\w+))?(//(\w+))?$`)
 
-func domainAndMask(re *regexp.Regexp, field, domain string) (string, DualMasks, error) {
-	masks := DualMasks{-1, -1}
+func domainAndMask(re *regexp.Regexp, field, domain string) (string, dualMasks, error) {
+	masks := dualMasks{-1, -1}
 	groups := re.FindStringSubmatch(field)
 	if groups != nil {
 		if groups[2] != "" {