mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
23 lines
303 B
Go
23 lines
303 B
Go
package util
|
|
|
|
import (
|
|
"net/url"
|
|
"os"
|
|
)
|
|
|
|
func HomeDir() string {
|
|
if h := os.Getenv("HOME"); h != "" {
|
|
return h
|
|
}
|
|
return os.Getenv("USERPROFILE") // windows
|
|
}
|
|
|
|
func IsURL(str string) bool {
|
|
parsed, err := url.ParseRequestURI(str)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
|
|
return parsed.Scheme != ""
|
|
}
|