Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions accounts-management/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package errors
import (
"errors"
"fmt"
"maps"
)

type ErrorCode int
Expand Down Expand Up @@ -48,9 +49,7 @@ func (e *AccountsError) Copy() *AccountsError {
var ctx map[string]interface{}
if e.Context != nil {
ctx = make(map[string]interface{}, len(e.Context))
for k, v := range e.Context {
ctx[k] = v
}
maps.Copy(ctx, e.Context)
}

return &AccountsError{
Expand Down
5 changes: 2 additions & 3 deletions centralizedmetrics/providers/mixpanel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"maps"
"net/http"

"go.uber.org/zap"
Expand Down Expand Up @@ -148,9 +149,7 @@ func (p mixpanelMetricProperties) MarshalJSON() ([]byte, error) {
}

// Merge AdditionalProperties into the map
for key, value := range p.AdditionalProperties {
mmpMap[key] = value
}
maps.Copy(mmpMap, p.AdditionalProperties)

// Marshal the merged map back to JSON
marshaled, err := json.Marshal(mmpMap)
Expand Down
5 changes: 2 additions & 3 deletions services/wallet/thirdparty/utils/chunk_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"context"
"fmt"
"maps"
"slices"
"time"
)
Expand Down Expand Up @@ -58,9 +59,7 @@ func ChunkMapFetcher[T any](

result := make(map[string]T)
for _, chunkResult := range chunkResults {
for k, v := range chunkResult {
result[k] = v
}
maps.Copy(result, chunkResult)
}

return result, nil
Expand Down