ебать крупнейшее обновление 1.0
This commit is contained in:
1 parent
22359129af
commit
d6ebd95cbd
6 files changed
+1809
-351
No files matched your search
@@ -2,6 +2,8 @@ package helpers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"path/filepath"
|
||||
"math/rand"
|
||||
@@ -25,6 +27,18 @@ func Ask(str string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func HTTPClient() *http.Client {
|
||||
transport := &http.Transport{
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 10 * time.Second,
|
||||
}).DialContext,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
}
|
||||
return &http.Client{
|
||||
Transport: transport,
|
||||
}
|
||||
}
|
||||
|
||||
func ToString(v interface{}) string {
|
||||
switch val := v.(type) {
|
||||
case int:
|
||||
@@ -67,6 +81,9 @@ func CopyDir(src, dst string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.RemoveAll(target); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Symlink(link, target)
|
||||
|
||||
case info.IsDir():
|
||||
|
||||
Reference in new issue
Block a user