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
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@ -54,7 +54,7 @@ jobs:
|
||||
- name: Golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.52.2
|
||||
version: v1.55.2
|
||||
args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number
|
||||
|
||||
build:
|
||||
|
@ -21,6 +21,7 @@ linters:
|
||||
- nilerr
|
||||
- whitespace
|
||||
- misspell
|
||||
- mirror
|
||||
- usestdlibvars
|
||||
- errname
|
||||
|
||||
|
@ -137,16 +137,16 @@ func logValidatorWebAuth(validatorWebAddr, token string, tokenPath string) {
|
||||
func saveAuthToken(walletDirPath string, jwtKey []byte, token string) error {
|
||||
hashFilePath := filepath.Join(walletDirPath, AuthTokenFileName)
|
||||
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
|
||||
}
|
||||
if _, err := bytesBuf.Write([]byte("\n")); err != nil {
|
||||
if _, err := bytesBuf.WriteString("\n"); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := bytesBuf.Write([]byte(token)); err != nil {
|
||||
if _, err := bytesBuf.WriteString(token); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := bytesBuf.Write([]byte("\n")); err != nil {
|
||||
if _, err := bytesBuf.WriteString("\n"); err != nil {
|
||||
return err
|
||||
}
|
||||
return file.WriteFile(hashFilePath, bytesBuf.Bytes())
|
||||
|
@ -132,7 +132,7 @@ func (s *Server) ImportKeystores(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if req.SlashingProtection != "" {
|
||||
if err := slashingprotection.ImportStandardProtectionJSON(
|
||||
ctx, s.valDB, bytes.NewBuffer([]byte(req.SlashingProtection)),
|
||||
ctx, s.valDB, bytes.NewBufferString(req.SlashingProtection),
|
||||
); err != nil {
|
||||
statuses := make([]*keymanager.KeyStatus, len(req.Keystores))
|
||||
for i := 0; i < len(req.Keystores); i++ {
|
||||
|
Loading…
Reference in New Issue
Block a user