mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 11:29:10 +08:00
17 lines
237 B
Go
17 lines
237 B
Go
package single_instance
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
)
|
|
|
|
func GetLockFilePid(filename string) (pid int, err error) {
|
|
contents, err := os.ReadFile(filename)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
pid, err = strconv.Atoi(string(contents))
|
|
return
|
|
}
|