mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
21 lines
406 B
Go
21 lines
406 B
Go
package cache
|
|
|
|
import "github.com/jandedobbeleer/oh-my-posh/src/concurrent"
|
|
|
|
type Command struct {
|
|
Commands *concurrent.Map
|
|
}
|
|
|
|
func (c *Command) Set(command, path string) {
|
|
c.Commands.Set(command, path)
|
|
}
|
|
|
|
func (c *Command) Get(command string) (string, bool) {
|
|
cacheCommand, found := c.Commands.Get(command)
|
|
if !found {
|
|
return "", false
|
|
}
|
|
command, ok := cacheCommand.(string)
|
|
return command, ok
|
|
}
|