forked from TrueCloudLab/frostfs-node
[#973] node: Resolve perfsprint linter
`fmt.Errorf can be replaced with errors.New` and `fmt.Sprintf can be replaced with string addition` Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
66a26b7775
commit
d433b49265
39 changed files with 143 additions and 72 deletions
|
@ -29,6 +29,8 @@ var NetmapConfigKeys = []string{
|
|||
netmap.MaintenanceModeAllowedConfig,
|
||||
}
|
||||
|
||||
var errFailedToFetchListOfNetworkKeys = errors.New("can't fetch list of network config keys from the netmap contract")
|
||||
|
||||
func GetDefaultNetmapContractConfigMap() map[string]any {
|
||||
m := make(map[string]any)
|
||||
m[netmap.EpochDurationConfig] = viper.GetInt64(commonflags.EpochDurationInitFlag)
|
||||
|
@ -95,7 +97,7 @@ func GetNetConfigFromNetmapContract(roInvoker *invoker.Invoker) ([]stackitem.Ite
|
|||
}
|
||||
arr, err := unwrap.Array(roInvoker.Call(nmHash, "listConfig"))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't fetch list of network config keys from the netmap contract")
|
||||
return nil, errFailedToFetchListOfNetworkKeys
|
||||
}
|
||||
return arr, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue