diff --git a/README.md b/README.md index cd76ace..5213981 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-objectid -[![Go Report Card](https://goreportcard.com/badge/JesseCoretta/go-objectid)](https://goreportcard.com/report/github.com/JesseCoretta/go-objectid) [![Go Reference](https://pkg.go.dev/badge/github.com/JesseCoretta/go-objectid.svg)](https://pkg.go.dev/github.com/JesseCoretta/go-objectid) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/JesseCoretta/go-objectid/blob/main/LICENSE) [![codecov](https://codecov.io/gh/JesseCoretta/go-objectid/graph/badge.svg?token=RLW4DHLKQP)](https://codecov.io/gh/JesseCoretta/go-objectid) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/JesseCoretta/go-objectid/issues) [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/JesseCoretta/go-objectid/go.yml)](https://github.com/JesseCoretta/go-objectid/actions/workflows/go.yml) [![Author](https://img.shields.io/badge/author-Jesse_Coretta-darkred?label=%F0%9F%94%BA&labelColor=indigo&color=maroon)](mailto:jesse.coretta@icloud.com) [![Help Animals](https://img.shields.io/badge/help_animals-gray?label=%F0%9F%90%BE%20%F0%9F%98%BC%20%F0%9F%90%B6&labelColor=yellow)](https://github.com/JesseCoretta/JesseCoretta/blob/main/DONATIONS.md) +[![Go Report Card](https://goreportcard.com/badge/JesseCoretta/go-objectid)](https://goreportcard.com/report/github.com/JesseCoretta/go-objectid) [![CodeQL](https://github.com/JesseCoretta/go-objectid/workflows/CodeQL/badge.svg)](https://github.com/JesseCoretta/go-objectid/actions/workflows/github-code-scanning/codeql) [![Go Reference](https://pkg.go.dev/badge/github.com/JesseCoretta/go-objectid.svg)](https://pkg.go.dev/github.com/JesseCoretta/go-objectid) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/JesseCoretta/go-objectid/blob/main/LICENSE) [![codecov](https://codecov.io/gh/JesseCoretta/go-objectid/graph/badge.svg?token=RLW4DHLKQP)](https://codecov.io/gh/JesseCoretta/go-objectid) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/JesseCoretta/go-objectid/issues) [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/JesseCoretta/go-objectid/go.yml)](https://github.com/JesseCoretta/go-objectid/actions/workflows/go.yml) [![GitHub release (with filter)](https://img.shields.io/github/v/release/JesseCoretta/go-objectid)](https://github.com/JesseCoretta/go-objectid/releases) [![Author](https://img.shields.io/badge/author-Jesse_Coretta-darkred?label=%F0%9F%94%BA&labelColor=indigo&color=maroon)](mailto:jesse.coretta@icloud.com) [![Help Animals](https://img.shields.io/badge/help_animals-gray?label=%F0%9F%90%BE%20%F0%9F%98%BC%20%F0%9F%90%B6&labelColor=yellow)](https://github.com/JesseCoretta/JesseCoretta/blob/main/DONATIONS.md) -Package objectid offers convenient ASN.1 Object Identifier types with useful methods and a uint128-based NumberForm type allowing X.667 support. +Package objectid offers convenient ASN.1 Object Identifier types with useful methods and a `uint128`-based NumberForm type allowing support for [ITU-T Rec. X.667](https://www.itu.int/rec/T-REC-X.667) compliant ASN.1 Object Identifiers. diff --git a/asn.go b/asn.go index 7aec7cc..4b1eadd 100644 --- a/asn.go +++ b/asn.go @@ -1,14 +1,12 @@ package objectid /* -ASN1Notation contains an ordered sequence of NameAndNumberForm -instances. +ASN1Notation contains an ordered sequence of [NameAndNumberForm] instances. */ type ASN1Notation []NameAndNumberForm /* -String is a stringer method that returns a properly formatted -ASN.1 string value. +String is a stringer method that returns a properly formatted ASN.1 string value. */ func (a ASN1Notation) String() string { var x []string @@ -35,8 +33,7 @@ func (a ASN1Notation) Leaf() NameAndNumberForm { } /* -Parent returns the leaf node's parent (-2) string value from -the receiver. +Parent returns the leaf node's parent (-2) string value from the receiver. */ func (a ASN1Notation) Parent() NameAndNumberForm { x, _ := a.Index(-2) @@ -49,8 +46,7 @@ Len returns the integer length of the receiver. func (a ASN1Notation) Len() int { return len(a) } /* -IsZero returns a boolean indicative of whether the receiver -is unset. +IsZero returns a Boolean indicative of whether the receiver is unset. */ func (a ASN1Notation) IsZero() (is bool) { if is = &a == nil; !is { @@ -61,7 +57,7 @@ func (a ASN1Notation) IsZero() (is bool) { } /* -Index returns the Nth index from the receiver, alongside a boolean +Index returns the Nth index from the receiver, alongside a Boolean value indicative of success. This method supports the use of negative indices. */ @@ -92,12 +88,12 @@ func (a ASN1Notation) Index(idx int) (nanf NameAndNumberForm, ok bool) { } /* -NewASN1Notation returns an instance of *ASN1Notation alongside an error. +NewASN1Notation returns an instance of *[ASN1Notation] alongside an error. Valid input forms for ASN.1 values are string (e.g.: "{iso(1)}") and string slices (e.g.: []string{"iso(1)", "identified-organization(3)" ...}). -NumberForm values CANNOT be negative, and CANNOT overflow NumberForm (uint128). +[NumberForm] values CANNOT be negative, and CANNOT overflow [NumberForm] (uint128). */ func NewASN1Notation(x any) (a *ASN1Notation, err error) { // prepare temporary instance @@ -139,7 +135,7 @@ func NewASN1Notation(x any) (a *ASN1Notation, err error) { } /* -Valid returns a boolean value indicative of whether the receiver's +Valid returns a Boolean value indicative of whether the receiver's length is greater than or equal to one (1) slice member. */ func (a ASN1Notation) Valid() (is bool) { @@ -156,11 +152,11 @@ func (a ASN1Notation) Valid() (is bool) { } /* -Ancestry returns slices of DotNotation values ordered from leaf node +Ancestry returns slices of [DotNotation] values ordered from leaf node (first) to root node (last). Empty slices of DotNotation are returned if the dotNotation value -within the receiver is less than two (2) NumberForm values in length. +within the receiver is less than two (2) [NumberForm] values in length. */ func (a ASN1Notation) Ancestry() (anc []ASN1Notation) { if a.Len() >= 2 { @@ -173,9 +169,9 @@ func (a ASN1Notation) Ancestry() (anc []ASN1Notation) { } /* -NewSubordinate returns a new instance of ASN1Notation based upon the -contents of the receiver as well as the input NameAndNumberForm -subordinate value. This creates a fully-qualified child ASN1Notation +NewSubordinate returns a new instance of [ASN1Notation] based upon the +contents of the receiver as well as the input [NameAndNumberForm] +subordinate value. This creates a fully-qualified child [ASN1Notation] value of the receiver. */ func (a ASN1Notation) NewSubordinate(nanf any) *ASN1Notation { @@ -196,8 +192,8 @@ func (a ASN1Notation) NewSubordinate(nanf any) *ASN1Notation { } /* -AncestorOf returns a boolean value indicative of whether the receiver -is an ancestor of the input value, which can be string or ASN1Notation. +AncestorOf returns a Boolean value indicative of whether the receiver +is an ancestor of the input value, which can be string or [ASN1Notation]. */ func (a ASN1Notation) AncestorOf(asn any) (anc bool) { if !a.IsZero() { diff --git a/doc.go b/doc.go index 4534ef4..2ce3b10 100644 --- a/doc.go +++ b/doc.go @@ -3,10 +3,10 @@ Package objectid implements ASN.1 Object Identifier types and methods. # Features - - Unsigned 128-bit numberForm support (allows for expressing registrations found below {joint-iso-itu-t(2) uuid(25)}, per [X.667](https://www.itu.int/rec/T-REC-X.667)) + - Unsigned 128-bit number form support (allows for expressing registrations found below {joint-iso-itu-t(2) uuid(25)}, per ITU-T Rec. X.667. - Flexible index support, allowing interrogation through negative indices without the risk of panic - Convenient Leaf, Parent and Root index alias methods, wherever applicable - - Ge, Gt, Le, Lt, Equal comparison methods for interacting with NumberForm instances + - Ge, Gt, Le, Lt, Equal comparison methods for interacting with [NumberForm] instances # License @@ -16,10 +16,10 @@ For further details, see the LICENSE file within the root of the source reposito # NumberForm Maximum -Valid NumberForm instances may fall between the minimum decimal value of zero (0) and the maximum decimal value of 340,282,366,920,938,463,463,374,607,431,768,211,455 (three hundred forty undecillion and change). This ensures no panics occur when parsing valid UUID-based object identifiers, such as those found beneath joint-iso-itu-t(2) uuid(25) per [X.667](https://www.itu.int/rec/T-REC-X.667). +Valid [NumberForm] instances may fall between the minimum decimal value of zero (0) and the maximum decimal value of 340,282,366,920,938,463,463,374,607,431,768,211,455 (three hundred forty undecillion and change). This ensures no panics occur when parsing UUID-based [OID]s. # Special Credit -A special thanks to Luke Champine for his excellent Uint128 package (found at https://github.com/lukechampine/uint128), which is incorporated within this package for [X.667](https://www.itu.int/rec/T-REC-X.667) support within NumberForm instances. +A special thanks to Luke Champine for his excellent Uint128 package (found at https://github.com/lukechampine/uint128), which is incorporated within this package. */ package objectid diff --git a/dot.go b/dot.go index c1fec9a..0341f71 100644 --- a/dot.go +++ b/dot.go @@ -1,13 +1,12 @@ package objectid /* -DotNotation contains an ordered sequence of NumberForm instances. +DotNotation contains an ordered sequence of [NumberForm] instances. */ type DotNotation []NumberForm /* -String is a stringer method that returns the dotNotation -form of the receiver (e.g.: "1.3.6.1"). +String is a stringer method that returns the dot notation form of the receiver (e.g.: "1.3.6.1"). */ func (d DotNotation) String() (s string) { if !d.IsZero() { @@ -22,7 +21,7 @@ func (d DotNotation) String() (s string) { } /* -Root returns the root node (0) NumberForm instance. +Root returns the root node (0) [NumberForm] instance. */ func (d DotNotation) Root() NumberForm { x, _ := d.Index(0) @@ -34,7 +33,7 @@ func (d DotNotation) Len() int { } /* -Leaf returns the leaf-node (-1) NumberForm instance. +Leaf returns the leaf-node (-1) [NumberForm] instance. */ func (d DotNotation) Leaf() NumberForm { x, _ := d.Index(-1) @@ -42,7 +41,7 @@ func (d DotNotation) Leaf() NumberForm { } /* -Parent returns the leaf-node's parent (-2) NumberForm instance. +Parent returns the leaf-node's parent (-2) [NumberForm] instance. */ func (d DotNotation) Parent() NumberForm { x, _ := d.Index(-2) @@ -50,8 +49,7 @@ func (d DotNotation) Parent() NumberForm { } /* -IsZero returns a boolean indicative of whether the receiver -is unset. +IsZero returns a Boolean indicative of whether the receiver is unset. */ func (d *DotNotation) IsZero() (is bool) { if d != nil { @@ -61,8 +59,7 @@ func (d *DotNotation) IsZero() (is bool) { } /* -NewDotNotation returns an instance of *DotNotation alongside a boolean -value indicative of success. +NewDotNotation returns an instance of *[DotNotation] alongside a Boolean value indicative of success. */ func NewDotNotation(id string) (d *DotNotation, err error) { if len(id) == 0 { @@ -91,7 +88,7 @@ IntSlice returns slices of integer values and an error. The integer values are b upon the contents of the receiver. Note that if any single arc number overflows int, a zero slice is returned. -Successful output can be cast as an instance of asn1.ObjectIdentifier, if desired. +Successful output can be cast as an instance of [encoding/asn1.ObjectIdentifier], if desired. */ func (d DotNotation) IntSlice() (slice []int, err error) { if d.IsZero() { @@ -114,7 +111,7 @@ func (d DotNotation) IntSlice() (slice []int, err error) { } /* -Index returns the Nth index from the receiver, alongside a boolean +Index returns the Nth index from the receiver, alongside a Boolean value indicative of success. This method supports the use of negative indices. */ @@ -137,11 +134,11 @@ func (d DotNotation) Index(idx int) (a NumberForm, ok bool) { } /* -Ancestry returns slices of DotNotation values ordered from leaf +Ancestry returns slices of [DotNotation] values ordered from leaf node (first) to root node (last). -Empty slices of DotNotation are returned if the dotNotation value -within the receiver is less than two (2) NumberForm values in length. +Empty slices of [DotNotation] are returned if the dot notation value +within the receiver is less than two (2) [NumberForm] values in length. */ func (d DotNotation) Ancestry() (anc []DotNotation) { if d.Len() > 0 { @@ -154,8 +151,8 @@ func (d DotNotation) Ancestry() (anc []DotNotation) { } /* -AncestorOf returns a boolean value indicative of whether the receiver -is an ancestor of the input value, which can be string or DotNotation. +AncestorOf returns a Boolean value indicative of whether the receiver +is an ancestor of the input value, which can be string or [DotNotation]. */ func (d DotNotation) AncestorOf(dot any) (is bool) { if !d.IsZero() { @@ -198,9 +195,9 @@ func (d DotNotation) matchDotNot(dot *DotNotation) bool { } /* -NewSubordinate returns a new instance of DotNotation based upon the -contents of the receiver as well as the input NumberForm subordinate -value. This creates a fully-qualified child DotNotation value of the +NewSubordinate returns a new instance of [DotNotation] based upon the +contents of the receiver as well as the input [NumberForm] subordinate +value. This creates a fully-qualified child [DotNotation] value of the receiver. */ func (d DotNotation) NewSubordinate(nf any) (dot *DotNotation) { @@ -221,7 +218,7 @@ func (d DotNotation) NewSubordinate(nf any) (dot *DotNotation) { } /* -Valid returns a boolean value indicative of the following: +Valid returns a Boolean value indicative of the following: • Receiver's length is greater than or equal to one (1) slice member, and ... • The first slice in the receiver contains a decimal value that is less than three (3) diff --git a/nanf.go b/nanf.go index 1a4e85f..2148409 100644 --- a/nanf.go +++ b/nanf.go @@ -7,7 +7,7 @@ nanf.go deals with NameAndNumberForm syntax and viability /* NameAndNumberForm contains either an identifier with a parenthesis-enclosed decimal value, or a decimal value alone. An ordered sequence of instances of -this type comprise an instance of ASN1Notation. +this type comprise an instance of [ASN1Notation]. */ type NameAndNumberForm struct { identifier string @@ -16,7 +16,7 @@ type NameAndNumberForm struct { } /* -IsZero returns a boolean valu indicative of whether +IsZero returns a Boolean valu indicative of whether the receiver is considered nil. */ func (nanf NameAndNumberForm) IsZero() bool { @@ -32,7 +32,7 @@ func (nanf NameAndNumberForm) Identifier() string { } /* -NumberForm returns the underlying NumberForm +NumberForm returns the underlying [NumberForm] value assigned to the receiver instance. */ func (nanf NameAndNumberForm) NumberForm() NumberForm { @@ -41,7 +41,7 @@ func (nanf NameAndNumberForm) NumberForm() NumberForm { /* String is a stringer method that returns the properly -formatted NameAndNumberForm string value. +formatted [NameAndNumberForm] string value. */ func (nanf NameAndNumberForm) String() (val string) { n := nanf.primaryIdentifier.String() @@ -52,8 +52,8 @@ func (nanf NameAndNumberForm) String() (val string) { } /* -Equal returns a boolean value indicative of whether instance -n of NameAndNumberForm matches the receiver. +Equal returns a Boolean value indicative of whether instance +n of [NameAndNumberForm] matches the receiver. */ func (nanf NameAndNumberForm) Equal(n any) (is bool) { switch tv := n.(type) { @@ -69,7 +69,7 @@ func (nanf NameAndNumberForm) Equal(n any) (is bool) { } /* -parseNaNFstr returns an instance of *NameAndNumberForm alongside an error. +parseNaNFstr returns an instance of *[NameAndNumberForm] alongside an error. */ func parseNaNFstr(x string) (nanf *NameAndNumberForm, err error) { // Don't waste time on bogus values. @@ -116,15 +116,15 @@ func parseNaNFstr(x string) (nanf *NameAndNumberForm, err error) { } /* -NewNameAndNumberForm returns an instance of *NameAndNumberForm +NewNameAndNumberForm returns an instance of *[NameAndNumberForm] alongside an error. Valid input forms are: • nameAndNumberForm (e.g.: "enterprise(1)"), or ... • numberForm (e.g.: 1) -NumberForm components CANNOT be negative and CANNOT overflow -NumberForm (uint128). Permitted input types are string, uint64 +[NumberForm] components CANNOT be negative and CANNOT overflow +[NumberForm] (uint128). Permitted input types are string, uint64 and (non-negative) int. */ func NewNameAndNumberForm(x any) (nanf *NameAndNumberForm, err error) { diff --git a/nf.go b/nf.go index 6669e92..7332f7e 100644 --- a/nf.go +++ b/nf.go @@ -17,9 +17,9 @@ var nilNF NumberForm /* NumberForm is an unsigned 128-bit number. This type is based on -github.com/lukechampine/uint128. It has been incorporated -into this package to produce unsigned 128-bit OID numberForm -support (i.e.: UUID-based OIDs). +github.com/lukechampine/uint128. It has been incorporated into +this package to produce unsigned 128-bit [OID] numberForm support +(i.e.: UUID-based [OID]s). */ type NumberForm struct { lo, hi uint64 @@ -41,7 +41,7 @@ func (a *NumberForm) IsZero() (is bool) { /* Equal returns a boolean value indicative of whether the receiver is equal to -the value provided. Valid input types are string, uint64, int and NumberForm. +the value provided. Valid input types are string, uint64, int and [NumberForm]. Any input that represents a negative number guarantees a false return. */ @@ -66,7 +66,7 @@ func (a NumberForm) Equal(n any) (is bool) { /* Gt returns a boolean value indicative of whether the receiver is greater than -the value provided. Valid input types are string, uint64, int and NumberForm. +the value provided. Valid input types are string, uint64, int and [NumberForm]. Any input that represents a negative number guarantees a false return. */ @@ -87,8 +87,8 @@ func (a NumberForm) Gt(n any) (is bool) { /* Ge returns a boolean value indicative of whether the receiver is greater than or equal to the value provided. Valid input types are string, uint64, int and -NumberForm. This method is merely a convenient wrapper to an ORed call of the -NumberForm.Gt and NumberForm.Equal methods. +[NumberForm]. This method is merely a convenient wrapper to an ORed call of the +[NumberForm.Gt] and [NumberForm.Equal] methods. Any input that represents a negative number guarantees a false return. */ @@ -98,7 +98,7 @@ func (a NumberForm) Ge(n any) (is bool) { /* Lt returns a boolean value indicative of whether the receiver is less than -the value provided. Valid input types are string, uint64, int and NumberForm. +the value provided. Valid input types are string, uint64, int and [NumberForm]. Any input that represents a negative number guarantees a false return. */ @@ -119,8 +119,8 @@ func (a NumberForm) Lt(n any) (is bool) { /* Le returns a boolean value indicative of whether the receiver is less than or equal to the value provided. Valid input types are string, uint64, int and -NumberForm. This method is merely a convenient wrapper to an ORed call of the -NumberForm.Lt and NumberForm.Equal methods. +[NumberForm]. This method is merely a convenient wrapper to an ORed call of the +[NumberForm.Lt] and [NumberForm.Equal] methods. Any input that represents a negative number guarantees a false return. */ @@ -147,7 +147,7 @@ func (a NumberForm) gtLt(x any, lt bool) bool { } /* -Valid returns a boolean valud indicative of proper instantiation. +Valid returns a Boolean value indicative of proper initialization. */ func (a NumberForm) Valid() bool { return a.parsed @@ -198,7 +198,7 @@ func (a NumberForm) String() string { /* Scan implements fmt.Scanner, and is only present to allow conversion -of an NumberForm into a string value per fmt.Sscan. Users need not +of an [NumberForm] into a string value per [fmt.Sscan]. Users need not execute this method directly. */ func (a *NumberForm) Scan(s fmt.ScanState, ch rune) error { @@ -217,13 +217,13 @@ func (a NumberForm) quoRem64(v uint64) (q NumberForm, r uint64) { return } -// NewNumberForm returns the NumberForm value. +// NewNumberForm returns the [NumberForm] value. func newNumberForm(lo, hi uint64) NumberForm { return NumberForm{lo: lo, hi: hi, parsed: true} } /* -NewNumberForm converts v into an instance of NumberForm, which +NewNumberForm converts v into an instance of [NumberForm], which is returned alongside an error. Acceptable input types are string, int and uint64. No decimal value, diff --git a/nf_test.go b/nf_test.go index b1fc711..b9633d8 100644 --- a/nf_test.go +++ b/nf_test.go @@ -6,11 +6,14 @@ import ( ) func TestNewNumberForm(t *testing.T) { + // even #s = valid + // odd #s = invalid for idx, num := range []any{ `3849141823758536772162786183725055278`, -103, - 4874893, - ``, + `9399368356398566872162777255735125541`, + `939936835639856687216277725573512554138275978532897358923759872389572389572893758923758923758923759823`, // >uint128 + `0`, } { nf, err := NewNumberForm(num) ok := err == nil @@ -24,6 +27,7 @@ func TestNewNumberForm(t *testing.T) { _ = nf.len() _ = nf.String() + _, _ = nf.quoRem64(uint64(idx+1)) // codecov } var nf NumberForm diff --git a/oid.go b/oid.go index 8a1c35b..2a6db43 100644 --- a/oid.go +++ b/oid.go @@ -1,7 +1,7 @@ package objectid /* -OID contains an underlying ASN1Notation value, and extends convenient methods allowing +OID contains an underlying [ASN1Notation] value, and extends convenient methods allowing interrogation and verification. */ type OID struct { @@ -10,7 +10,7 @@ type OID struct { } /* -IsZero checks the receiver for nilness and returns a boolean indicative of the result. +IsZero checks the receiver for nilness and returns a Boolean indicative of the result. */ func (id *OID) IsZero() (is bool) { if id != nil { @@ -20,7 +20,7 @@ func (id *OID) IsZero() (is bool) { } /* -Dot returns a DotNotation instance based on the contents of the underlying ASN1Notation +Dot returns a [DotNotation] instance based on the contents of the underlying [ASN1Notation] instance found within the receiver. */ func (id OID) Dot() (d DotNotation) { @@ -35,7 +35,7 @@ func (id OID) Dot() (d DotNotation) { } /* -ASN returns the underlying ASN1Notation instance found within the receiver. +ASN returns the underlying [ASN1Notation] instance found within the receiver. */ func (id OID) ASN() (a ASN1Notation) { if !id.IsZero() { @@ -45,7 +45,7 @@ func (id OID) ASN() (a ASN1Notation) { } /* -Valid returns a boolean value indicative of whether the receiver's state is considered value. +Valid returns a Boolean value indicative of whether the receiver's state is considered value. */ func (id OID) Valid() (ok bool) { if !id.IsZero() { @@ -65,7 +65,7 @@ func (id OID) Valid() (ok bool) { } /* -Len returns the integer length of all underlying NumberForm values present within the receiver. +Len returns the integer length of all underlying [NumberForm] values present within the receiver. */ func (id OID) Len() (i int) { if !id.IsZero() { @@ -76,7 +76,7 @@ func (id OID) Len() (i int) { } /* -Leaf returns the leaf-node instance of NameAndNumberForm. +Leaf returns the leaf-node instance of [NameAndNumberForm]. */ func (id OID) Leaf() (nanf NameAndNumberForm) { if !id.IsZero() { @@ -86,7 +86,7 @@ func (id OID) Leaf() (nanf NameAndNumberForm) { } /* -Parent returns the leaf-node's Parent instance of NameAndNumberForm. +Parent returns the leaf-node's Parent instance of [NameAndNumberForm]. */ func (id OID) Parent() (nanf NameAndNumberForm) { if !id.IsZero() { @@ -96,7 +96,7 @@ func (id OID) Parent() (nanf NameAndNumberForm) { } /* -Root returns the root node instance of NameAndNumberForm. +Root returns the root node instance of [NameAndNumberForm]. */ func (id OID) Root() (nanf NameAndNumberForm) { if !id.IsZero() { @@ -106,13 +106,13 @@ func (id OID) Root() (nanf NameAndNumberForm) { } /* -NewOID creates an instance of OID and returns it alongside an error. +NewOID creates an instance of [OID] and returns it alongside an error. -The correct raw input syntax is the ASN.1 NameAndNumberForm sequence syntax, i.e.: +The correct raw input syntax is the ASN.1 [NameAndNumberForm] sequence syntax, i.e.: {iso(1) identified-organization(3) dod(6)} -Not all NameAndNumberForm values (arcs) require actual names; they can be numbers alone or in the so-called nameAndNumber syntax (name(Number)). For example: +Not all [NameAndNumberForm] values (arcs) require actual names; they can be numbers alone or in the so-called nameAndNumber syntax (name(Number)). For example: {iso(1) identified-organization(3) 6}