oh-my-posh/src/cache/command.go
2024-07-04 11:05:24 +02:00

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
}