Skip to content

Commit

Permalink
phonenumberutil: update package references
Browse files Browse the repository at this point in the history
Updates #105.
  • Loading branch information
kevinburke1 committed Jun 4, 2021
1 parent f43c7eb commit cfa6d68
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 18 deletions.
46 changes: 37 additions & 9 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


[[constraint]]
name = "github.com/golang/protobuf"
name = "google.golang.org/protobuf"
version = "1.0.0"

[[constraint]]
Expand Down
14 changes: 7 additions & 7 deletions phonenumberutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/ttacon/builder"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)

const (
Expand Down Expand Up @@ -2560,7 +2560,7 @@ func maybeExtractCountryCode(
}
potentialCountryCode := extractCountryCode(fullNumber, nationalNumber)
if potentialCountryCode != 0 {
phoneNumber.CountryCode = proto.Int(potentialCountryCode)
phoneNumber.CountryCode = proto.Int32(int32(potentialCountryCode))
return potentialCountryCode, nil
}

Expand Down Expand Up @@ -2610,13 +2610,13 @@ func maybeExtractCountryCode(
val := PhoneNumber_FROM_NUMBER_WITHOUT_PLUS_SIGN
phoneNumber.CountryCodeSource = &val
}
phoneNumber.CountryCode = proto.Int(defaultCountryCode)
phoneNumber.CountryCode = proto.Int32(int32(defaultCountryCode))
return defaultCountryCode, nil
}
}
}
// No country calling code present.
phoneNumber.CountryCode = proto.Int(0)
phoneNumber.CountryCode = proto.Int32(0)
return 0, nil
}

Expand Down Expand Up @@ -2867,7 +2867,7 @@ func setItalianLeadingZerosForPhoneNumber(
numLeadZeros++
}
if numLeadZeros != 1 {
phoneNumber.NumberOfLeadingZeros = proto.Int(numLeadZeros)
phoneNumber.NumberOfLeadingZeros = proto.Int32(int32(numLeadZeros))
}
}

Expand Down Expand Up @@ -2958,7 +2958,7 @@ func parseHelper(
normalizedNationalNumber.WriteString(normalize(nationalNumber.String()))
if len(defaultRegion) != 0 {
countryCode = int(regionMetadata.GetCountryCode())
phoneNumber.CountryCode = proto.Int(countryCode)
phoneNumber.CountryCode = proto.Int32(int32(countryCode))
} else if keepRawInput {
phoneNumber.CountryCodeSource = nil
}
Expand Down Expand Up @@ -3130,7 +3130,7 @@ func isNumberMatchWithNumbers(firstNumberIn, secondNumberIn *PhoneNumber) MatchT
// Checks cases where one or both country_code fields were not
// specified. To make equality checks easier, we first set the
// country_code fields to be equal.
firstNumber.CountryCode = proto.Int(int(secondNumberCountryCode))
firstNumber.CountryCode = proto.Int32(secondNumberCountryCode)
// If all else was the same, then this is an NSN_MATCH.
// TODO(ttacon): remove when make gen-equals
if reflect.DeepEqual(firstNumber, secondNumber) {
Expand Down
2 changes: 1 addition & 1 deletion phonenumberutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"regexp"
"testing"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)

func TestParse(t *testing.T) {
Expand Down

0 comments on commit cfa6d68

Please sign in to comment.