mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
Enable mirror linter and fix findings (#13342)
* Enable mirror linter and fix findings * Use latest version of golangci-lint * Use v1.55.2 instead of latest --------- Co-authored-by: terence <terence@prysmaticlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
parent
d57bca97a5
commit
ffe2f6b732
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ '*' ]
|
branches: [ '*' ]
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [checks_requested]
|
types: [checks_requested]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Golangci-lint
|
- name: Golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
version: v1.52.2
|
version: v1.55.2
|
||||||
args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number
|
args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
@ -21,6 +21,7 @@ linters:
|
|||||||
- nilerr
|
- nilerr
|
||||||
- whitespace
|
- whitespace
|
||||||
- misspell
|
- misspell
|
||||||
|
- mirror
|
||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
- errname
|
- errname
|
||||||
|
|
||||||
|
@ -137,16 +137,16 @@ func logValidatorWebAuth(validatorWebAddr, token string, tokenPath string) {
|
|||||||
func saveAuthToken(walletDirPath string, jwtKey []byte, token string) error {
|
func saveAuthToken(walletDirPath string, jwtKey []byte, token string) error {
|
||||||
hashFilePath := filepath.Join(walletDirPath, AuthTokenFileName)
|
hashFilePath := filepath.Join(walletDirPath, AuthTokenFileName)
|
||||||
bytesBuf := new(bytes.Buffer)
|
bytesBuf := new(bytes.Buffer)
|
||||||
if _, err := bytesBuf.Write([]byte(fmt.Sprintf("%x", jwtKey))); err != nil {
|
if _, err := bytesBuf.WriteString(fmt.Sprintf("%x", jwtKey)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := bytesBuf.Write([]byte("\n")); err != nil {
|
if _, err := bytesBuf.WriteString("\n"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := bytesBuf.Write([]byte(token)); err != nil {
|
if _, err := bytesBuf.WriteString(token); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := bytesBuf.Write([]byte("\n")); err != nil {
|
if _, err := bytesBuf.WriteString("\n"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return file.WriteFile(hashFilePath, bytesBuf.Bytes())
|
return file.WriteFile(hashFilePath, bytesBuf.Bytes())
|
||||||
|
@ -132,7 +132,7 @@ func (s *Server) ImportKeystores(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
if req.SlashingProtection != "" {
|
if req.SlashingProtection != "" {
|
||||||
if err := slashingprotection.ImportStandardProtectionJSON(
|
if err := slashingprotection.ImportStandardProtectionJSON(
|
||||||
ctx, s.valDB, bytes.NewBuffer([]byte(req.SlashingProtection)),
|
ctx, s.valDB, bytes.NewBufferString(req.SlashingProtection),
|
||||||
); err != nil {
|
); err != nil {
|
||||||
statuses := make([]*keymanager.KeyStatus, len(req.Keystores))
|
statuses := make([]*keymanager.KeyStatus, len(req.Keystores))
|
||||||
for i := 0; i < len(req.Keystores); i++ {
|
for i := 0; i < len(req.Keystores); i++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user