Fix: Add TTL and custom Timeout in DigitalOcean DNS provider
This commit is contained in:
parent
66485e81b4
commit
0ef1b7b683
120 changed files with 23764 additions and 9782 deletions
46
vendor/gopkg.in/mattes/go-expand-tilde.v1/tilde.go
generated
vendored
Normal file
46
vendor/gopkg.in/mattes/go-expand-tilde.v1/tilde.go
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
package tilde
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrNoHome = errors.New("no home found")
|
||||
)
|
||||
|
||||
func Expand(path string) (string, error) {
|
||||
if !strings.HasPrefix(path, "~") {
|
||||
return path, nil
|
||||
}
|
||||
|
||||
home, err := Home()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return home + path[1:], nil
|
||||
}
|
||||
|
||||
func Home() (string, error) {
|
||||
home := ""
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
home = filepath.Join(os.Getenv("HomeDrive"), os.Getenv("HomePath"))
|
||||
if home == "" {
|
||||
home = os.Getenv("UserProfile")
|
||||
}
|
||||
|
||||
default:
|
||||
home = os.Getenv("HOME")
|
||||
}
|
||||
|
||||
if home == "" {
|
||||
return "", ErrNoHome
|
||||
}
|
||||
return home, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue