linting
This commit is contained in:
@@ -31,6 +31,7 @@ func Load(path string) (*Config, error) {
|
||||
return nil, merrors.InvalidArgument("config: path is empty")
|
||||
}
|
||||
|
||||
//nolint:gosec // config path is provided by process startup arguments/config.
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, merrors.InternalWrap(err, "config: failed to read file")
|
||||
@@ -73,8 +74,10 @@ func Load(path string) (*Config, error) {
|
||||
}
|
||||
|
||||
if _, ok := sourceSet[driver]; !ok {
|
||||
return nil, merrors.InvalidArgument( //nolint:lll
|
||||
"config: pair references unknown source: "+driver.String(), "pairs."+driver.String())
|
||||
return nil, merrors.InvalidArgument(
|
||||
"config: pair references unknown source: "+driver.String(),
|
||||
"pairs."+driver.String(),
|
||||
)
|
||||
}
|
||||
|
||||
processed := make([]PairConfig, len(pairList))
|
||||
@@ -86,14 +89,16 @@ func Load(path string) (*Config, error) {
|
||||
pair.Symbol = strings.TrimSpace(pair.Symbol)
|
||||
|
||||
if pair.Base == "" || pair.Quote == "" || pair.Symbol == "" {
|
||||
return nil, merrors.InvalidArgument( //nolint:lll
|
||||
"config: pair entries must define base, quote, and symbol", "pairs."+driver.String())
|
||||
return nil, merrors.InvalidArgument(
|
||||
"config: pair entries must define base, quote, and symbol",
|
||||
"pairs."+driver.String(),
|
||||
)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(pair.Provider) == "" {
|
||||
pair.Provider = strings.ToLower(driver.String())
|
||||
}
|
||||
|
||||
|
||||
processed[idx] = pair
|
||||
flattened = append(flattened, Pair{
|
||||
PairConfig: pair,
|
||||
|
||||
Reference in New Issue
Block a user