ax(mining): replace banned errors import with ErrInternal in mining_profile.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

RawConfig.UnmarshalJSON used errors.New() (banned import) despite the
package already providing ErrInternal() for exactly this purpose.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 08:42:39 +01:00
parent 03d326a97e
commit 565dae709d
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -1,8 +1,5 @@
package mining
import (
"errors"
)
// RawConfig is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
@ -29,7 +26,7 @@ func (m RawConfig) MarshalJSON() ([]byte, error) {
// if err := json.Unmarshal(raw, &profile.Config); err != nil { ... }
func (m *RawConfig) UnmarshalJSON(data []byte) error {
if m == nil {
return errors.New("RawConfig: UnmarshalJSON on nil pointer")
return ErrInternal("RawConfig: UnmarshalJSON on nil pointer")
}
*m = append((*m)[0:0], data...)
return nil