Files
StarPilot/mapd_repo/utils/curry.go
T
firestar5683 1ce9f73ae2 Navigation and maps
Add navigation and map matching providers with the vendored map service sources.
2026-10-03 22:34:37 +00:00

21 lines
248 B
Go

package utils
type Curry[T any] struct {
set bool
val T
}
func (c *Curry[T]) Value(setter func() T) T {
if c.set {
return c.val
}
c.set = true
c.val = setter()
return c.val
}
func (c *Curry[T]) Set(val T) {
c.set = true
c.val = val
}