mirror of
https://github.com/Alexandre1a/GoSH.git
synced 2026-03-09 19:19:46 +01:00
27 lines
432 B
Go
27 lines
432 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
homeDir, err := os.UserHomeDir()
|
|
if err != nil {
|
|
return
|
|
}
|
|
if fileExists(homeDir+"/.gosh_history") {
|
|
fmt.Println("GoSh History file exists")
|
|
} else {
|
|
fmt.Println("GoSh History file does not exist")
|
|
}
|
|
}
|
|
|
|
func fileExists(filename string) bool {
|
|
info, err := os.Stat(filename)
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
return !info.IsDir()
|
|
}
|