Skip to content

Commit

Permalink
classic Go
Browse files Browse the repository at this point in the history
  • Loading branch information
kzys committed Nov 21, 2023
1 parent 9f83b18 commit ff8e07b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TimeOrNil(ts *timestamppb.Timestamp) *time.Time {
func PointerSlice[T any](from []T) []*T {
var result []*T
for _, x := range from {
x := x
result = append(result, &x)
}
return result
Expand Down Expand Up @@ -63,6 +64,7 @@ func FromPointerMap[K ~string, V any](from map[string]*V) map[K]V {
func ToPointerMap[K ~string, V any](from map[K]V) map[string]*V {
result := make(map[string]*V)
for k, v := range from {
v := v
result[string(k)] = &v
}
return result
Expand Down

0 comments on commit ff8e07b

Please sign in to comment.