In https://github.com/acim/hcdns/blob/67aba980225b00175b4cb6ba824405bd797be6e2/client.go#L75 it is attempted to add client references to the zones by iterating over an array using the syntax for _, z := range zones and modifying the variable z. This has no effect on the underlying array since the range operator returns a copy of the element rather than a reference, as documented e.g. here.
An error nil pointer dereference occurs when attempting to use the client of a zone or record, e.g. by calling record.UpdateValue(…). It can easily be reproduced by inserting
In https://github.com/acim/hcdns/blob/67aba980225b00175b4cb6ba824405bd797be6e2/client.go#L75 it is attempted to add client references to the zones by iterating over an array using the syntax
for _, z := range zones
and modifying the variablez
. This has no effect on the underlying array since therange
operator returns a copy of the element rather than a reference, as documented e.g. here.The same issue occurs at https://github.com/acim/hcdns/blob/67aba980225b00175b4cb6ba824405bd797be6e2/zone.go#L101
An error
nil pointer dereference
occurs when attempting to use the client of a zone or record, e.g. by callingrecord.UpdateValue(…)
. It can easily be reproduced by insertingafter https://github.com/acim/hcdns/blob/67aba980225b00175b4cb6ba824405bd797be6e2/zone_test.go#L36
I will propose a fix shortly.