GoSH/conf.go
2025-01-29 08:50:16 +01:00

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()
}