mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
aaffaebe55
Refactor Twitch client and bot so it can be closed and reopened with a different config. Add a cancellation function to subscription functions so they can be cancelled. Use http.Handler instead of HandlerFunc for custom routes
14 lines
249 B
Go
14 lines
249 B
Go
package utils
|
|
|
|
import "git.sr.ht/~hamcha/containers"
|
|
|
|
func MergeMap[T comparable, V any](a, b map[T]V) {
|
|
for key, value := range b {
|
|
a[key] = value
|
|
}
|
|
}
|
|
|
|
func MergeSyncMap[T comparable, V any](a, b *containers.SyncMap[T, V]) {
|
|
b.Set(a.Copy())
|
|
}
|