mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
17 lines
316 B
Go
17 lines
316 B
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"os/user"
|
|
)
|
|
|
|
// SocketName returns the path of the per-user Unix socket elvish and elvishd
|
|
// use for communication.
|
|
func SocketName() (string, error) {
|
|
user, err := user.Current()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return fmt.Sprintf("/tmp/elvishd-%s.sock", user.Username), nil
|
|
}
|