mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-12 15:33:45 +08:00
1ce9f73ae2
Add navigation and map matching providers with the vendored map service sources.
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
|
|
}
|