Skip to content

improvements: clean code #65

improvements: clean code

improvements: clean code #65

GitHub Actions / GolangCI Lint failed Dec 4, 2023 in 1s

reviewdog [GolangCI Lint] report

reported by reviewdog 🐶

Findings (10)

pkg/collector/ibc_collector.go|70 col 2| assignments should only be cuddled with other assignments (wsl)
pkg/collector/ibc_collector.go|71 col 2| declarations should never be cuddled (wsl)
pkg/collector/wallet_balance_collector.go|19| File is not gofumpt-ed with -extra (gofumpt)
pkg/collector/wallet_balance_collector.go|38 col 2| declarations should never be cuddled (wsl)
pkg/collector/wallet_balance_collector.go|39 col 2| assignments should only be cuddled with other assignments (wsl)
pkg/config/config.go|44 col 2| structtag: struct field tag yaml:"rpc" validate not compatible with reflect.StructTag.Get: bad syntax for struct tag pair (govet)
pkg/config/config.go|232 col 29| Error return value of validate.RegisterValidation is not checked (errcheck)
pkg/config/config.go|234 col 3| var-naming: don't use underscores in Go names; var val_arr should be valArr (revive)
pkg/config/config.go|249| File is not gofumpt-ed with -extra (gofumpt)
pkg/config/config.go|250 col 2| block should not end with a whitespace (or comment) (wsl)

Filtered Findings (3)

pkg/config/config.go|24| File is not gofumpt-ed with -extra (gofumpt)
pkg/config/config.go|204 col 4| only one cuddle assignment allowed before if statement (wsl)
pkg/ibc/ibc.go|110 col 2| if statements should only be cuddled with assignments (wsl)

Annotations

Check failure on line 70 in pkg/collector/ibc_collector.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/collector/ibc_collector.go#L70

assignments should only be cuddled with other assignments (wsl)
Raw output
pkg/collector/ibc_collector.go:70:2: assignments should only be cuddled with other assignments (wsl)
	ctx := context.Background()
	^

Check failure on line 71 in pkg/collector/ibc_collector.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/collector/ibc_collector.go#L71

declarations should never be cuddled (wsl)
Raw output
pkg/collector/ibc_collector.go:71:2: declarations should never be cuddled (wsl)
	var wg sync.WaitGroup
	^

Check failure on line 19 in pkg/collector/wallet_balance_collector.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/collector/wallet_balance_collector.go#L19

File is not `gofumpt`-ed with `-extra` (gofumpt)
Raw output
pkg/collector/wallet_balance_collector.go:19: File is not `gofumpt`-ed with `-extra` (gofumpt)
var (
	walletBalance = prometheus.NewDesc(
		walletBalanceMetricName,
		"Returns wallet balance for an address on a chain.",
		[]string{"account", "chain_id", "denom", "status"}, nil,
	)

Check failure on line 38 in pkg/collector/wallet_balance_collector.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/collector/wallet_balance_collector.go#L38

declarations should never be cuddled (wsl)
Raw output
pkg/collector/wallet_balance_collector.go:38:2: declarations should never be cuddled (wsl)
	var wg sync.WaitGroup
	^

Check failure on line 39 in pkg/collector/wallet_balance_collector.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/collector/wallet_balance_collector.go#L39

assignments should only be cuddled with other assignments (wsl)
Raw output
pkg/collector/wallet_balance_collector.go:39:2: assignments should only be cuddled with other assignments (wsl)
	ctx := context.Background()
	^

Check failure on line 44 in pkg/config/config.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/config/config.go#L44

structtag: struct field tag `yaml:"rpc" validate` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair (govet)
Raw output
pkg/config/config.go:44:2: structtag: struct field tag `yaml:"rpc" validate` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair (govet)
	RPCs             []RPC     `yaml:"rpc" validate`
	^

Check failure on line 232 in pkg/config/config.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/config/config.go#L232

Error return value of `validate.RegisterValidation` is not checked (errcheck)
Raw output
pkg/config/config.go:232:29: Error return value of `validate.RegisterValidation` is not checked (errcheck)
	validate.RegisterValidation("has_port", func(fl validator.FieldLevel) bool {
	                           ^

Check failure on line 234 in pkg/config/config.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/config/config.go#L234

var-naming: don't use underscores in Go names; var val_arr should be valArr (revive)
Raw output
pkg/config/config.go:234:3: var-naming: don't use underscores in Go names; var val_arr should be valArr (revive)
		val_arr := strings.Split(val, ":")
		^

Check failure on line 249 in pkg/config/config.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/config/config.go#L249

File is not `gofumpt`-ed with `-extra` (gofumpt)
Raw output
pkg/config/config.go:249: File is not `gofumpt`-ed with `-extra` (gofumpt)

Check failure on line 250 in pkg/config/config.go

See this annotation in the file changed.

@github-actions github-actions / GolangCI Lint

[GolangCI Lint] pkg/config/config.go#L250

block should not end with a whitespace (or comment) (wsl)
Raw output
pkg/config/config.go:250:2: block should not end with a whitespace (or comment) (wsl)
	}
	^