mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-28 00:53:45 +08:00
ab81464bd1
Add navigation and map matching providers with the vendored map service sources. Co-authored-by: Daniel Koepping <elkoled@gmail.com> Co-authored-by: Danny <dannyirwin31@yahoo.com> Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
21 lines
248 B
Go
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
|
|
}
|