ax(mining): replace banned errors import with ErrInternal in mining_profile.go
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:
parent
03d326a97e
commit
565dae709d
1 changed files with 1 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue