tile38/internal/server/must.go

17 lines
186 B
Go
Raw Normal View History

2022-09-24 23:57:03 +03:00
package server
func Must[T any](a T, err error) T {
if err != nil {
panic(err)
}
return a
}
func Default[T comparable](a, b T) T {
var c T
if a == c {
return b
}
return a
}