Skip to content

Commit

Permalink
chore: reduce go doc
Browse files Browse the repository at this point in the history
Signed-off-by: Caio Ferreira <[email protected]>
Signed-off-by: Justin McCarthy <[email protected]>
  • Loading branch information
Caio Ferreira authored and jmccarthy committed Apr 29, 2024
1 parent f7d8043 commit 78609a4
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions value.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,6 @@ type Decimal int64
const DecimalPrecision = 10000

// ParseDecimal takes a string representation of a decimal number and converts it into a Decimal type.
// The function handles optional negative sign and ensures that the decimal part of the number does not exceed four digits.
// It returns an error if the string is empty, contains non-digit characters, missing decimal point, or if the number overflows.
// The function also handles the case of negative numbers correctly to avoid overflow.
func ParseDecimal(s string) (Decimal, error) {
// Check for empty string.
if len(s) == 0 {
Expand Down Expand Up @@ -581,9 +578,6 @@ func (v Decimal) deepClone() Value { return v }
type IPAddr netip.Prefix

// ParseIPAddr takes a string representation of an IP address and converts it into an IPAddr type.
// The function handles both IPv4 and IPv6 addresses, and can also handle IP ranges.
// It disallows IPv4-mapped IPv6 addresses in dotted notation.
// The function returns an error if the string cannot be parsed into an IP address or IP range.
func ParseIPAddr(s string) (IPAddr, error) {
// We disallow IPv4-mapped IPv6 addresses in dotted notation because Cedar does.
if strings.Count(s, ":") >= 2 && strings.Count(s, ".") >= 2 {
Expand Down

0 comments on commit 78609a4

Please sign in to comment.