mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-07 22:56:37 +00:00
Add golangci-lint run
to lib/
(#181)
* [lib] Add .golangci.yaml as symlink https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories * [golangci-lint] Change `nakedret` settings * [linter] Can be replaced with faster hex.EncodeToString (perfsprint) * [linter] Fix too many quotes * [ci] Add `golangci-lint run` of `lib/` Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
dbd8e07a72
commit
e36eb6c2a1
2
.github/workflows/audit.yaml
vendored
2
.github/workflows/audit.yaml
vendored
@ -56,7 +56,7 @@ jobs:
|
|||||||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
|
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
run: golangci-lint run
|
run: (golangci-lint run && cd lib && golangci-lint run)
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -race -vet=off ./...
|
run: go test -race -vet=off ./...
|
||||||
|
@ -66,6 +66,9 @@ linters:
|
|||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
- wastedassign
|
- wastedassign
|
||||||
- zerologlint
|
- zerologlint
|
||||||
|
linters-settings:
|
||||||
|
nakedret:
|
||||||
|
max-func-lines: 100
|
||||||
issues:
|
issues:
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
- path: codec\.go
|
- path: codec\.go
|
||||||
|
1
lib/.golangci.yaml
Symbolic link
1
lib/.golangci.yaml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../.golangci.yaml
|
@ -10,7 +10,7 @@ import (
|
|||||||
// Config defines library top level configuration.
|
// Config defines library top level configuration.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ChainID string `mapstructure:"chain-id" json:"chain-id"`
|
ChainID string `mapstructure:"chain-id" json:"chain-id"`
|
||||||
EncodingConfig params.EncodingConfig `mapstructure:"encoding-config" json:"encoding-config""`
|
EncodingConfig params.EncodingConfig `mapstructure:"encoding-config" json:"encoding-config"`
|
||||||
RootDir string `mapstructure:"root-dir" json:"root-dir"`
|
RootDir string `mapstructure:"root-dir" json:"root-dir"`
|
||||||
RPCEndpoint string `mapstructure:"rpc-endpoint" json:"rpc-endpoint"`
|
RPCEndpoint string `mapstructure:"rpc-endpoint" json:"rpc-endpoint"`
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ func getKeyPairFromKeyring(address sdk.AccAddress) (keyPair KeyPair, err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
name := fmt.Sprintf("%x", []byte(address)) + ".address"
|
name := hex.EncodeToString([]byte(address)) + ".address"
|
||||||
i, err := ring.Get(name)
|
i, err := ring.Get(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user