From aa4f66edebcb942fed90dd72fc3e7239ed7ca0dc Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sat, 5 Jan 2019 22:12:59 -0500 Subject: [PATCH] fix some lint issues (#1239) * fix some lint issues * print error * unname the unused params --- beacon-chain/core/validators/validator.go | 2 +- shared/prometheus/service.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon-chain/core/validators/validator.go b/beacon-chain/core/validators/validator.go index 49c1c4d71b..139254e56c 100644 --- a/beacon-chain/core/validators/validator.go +++ b/beacon-chain/core/validators/validator.go @@ -414,7 +414,7 @@ func ProcessDeposit( state *pb.BeaconState, pubkey []byte, amount uint64, - proofOfPossession []byte, + _ /*proofOfPossession*/ []byte, withdrawalCredentials []byte, randaoCommitment []byte, pocCommitment []byte, diff --git a/shared/prometheus/service.go b/shared/prometheus/service.go index 33f4c8e635..2ebafe1c92 100644 --- a/shared/prometheus/service.go +++ b/shared/prometheus/service.go @@ -35,7 +35,7 @@ func NewPrometheusService(addr string, svcRegistry *shared.ServiceRegistry) *Ser return s } -func (s *Service) healthzHandler(w http.ResponseWriter, r *http.Request) { +func (s *Service) healthzHandler(w http.ResponseWriter, _ *http.Request) { // Call all services in the registry. // if any are not OK, write 500 // print the statuses of all services. @@ -51,6 +51,7 @@ func (s *Service) healthzHandler(w http.ResponseWriter, r *http.Request) { hasError = true status = "ERROR " + v.Error() } + if _, err := buf.WriteString(fmt.Sprintf("%s: %s\n", k, status)); err != nil { hasError = true status = "ERROR " + err.Error() @@ -65,7 +66,9 @@ func (s *Service) healthzHandler(w http.ResponseWriter, r *http.Request) { } // Write http body - w.Write(buf.Bytes()) + if _, err := w.Write(buf.Bytes()); err != nil { + log.Errorf("Could not write healthz body %v", err) + } } // Start the prometheus service.