Skip to content

Commit

Permalink
fix: code-review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Oct 18, 2022
1 parent 64263c0 commit 07470b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/api/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func (s *Service) balancesHandler(w http.ResponseWriter, _ *http.Request) {
balances, err := s.accounting.Balances()
if err != nil {
jsonhttp.InternalServerError(w, errCantBalances)
logger.Debug("balances: get balances failed", "error", err)
logger.Error(nil, "balances: get balances failed")
logger.Debug("get balances failed", "error", err)
logger.Error(nil, "get balances failed")
return
}

Expand Down
8 changes: 5 additions & 3 deletions pkg/api/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var preMapHooks = map[string]func(v string) (string, error){
}

// mapStructure maps the input to the output values.
// The input is on of the following:
// The input is one of the following:
// - map[string]string
// - map[string][]string
//
Expand All @@ -135,12 +135,14 @@ var preMapHooks = map[string]func(v string) (string, error){
// For example:
//
// type Output struct {
// BoolVal bool `map:"boolVal"`
// BoolVal bool `map:"boolVal,omitempty"`
// }
//
// If the `map` tag is not present, the field name is used.
// If the field name or the `map` tag is not present in
// the input map, the field is skipped.
// the input map, the field is skipped. If the map value
// is empty and the` omitempty` tag is present then the
// field is skipped.
//
// In case of parsing error, a new parseError is returned to the caller.
// The caller can use the Unwrap method to get the original error.
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/welcome_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *Service) getWelcomeMessageHandler(w http.ResponseWriter, r *http.Reques
}

func (s *Service) setWelcomeMessageHandler(w http.ResponseWriter, r *http.Request) {
logger := s.logger.WithName("post_wallet").Build()
logger := s.logger.WithName("post_welcome_message").Build()

var data welcomeMessageRequest
err := json.NewDecoder(r.Body).Decode(&data)
Expand Down

0 comments on commit 07470b8

Please sign in to comment.