diff options
author | Slack Coder <slackcoder@server.ky> | 2023-11-25 13:35:32 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2023-11-25 14:11:52 -0500 |
commit | b1ff30a420b35b4e53ca1fb9f64c14aa6b9034d2 (patch) | |
tree | 2cef043be308b692de15cd679daac06e47a11ef8 | |
parent | 2b23d8b0e3e47b91aed7ce775c581dafd3d5016b (diff) | |
download | slackware.com-cli-master.tar.xz |
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | internal/slackware_com/mirror.go | 9 |
2 files changed, 10 insertions, 10 deletions
@@ -64,6 +64,15 @@ Follow Golang's standard process for installing. It will install the command into the location pointed to by the GOBIN environment variable or its default value. +On Slackware , you want to install programs from third parties under +the '/usr/local' location. + +As root: + ``` -go install ./cmd/slackware.com +GOBIN=/usr/local/bin \ + go install -tags=netcgo ./cmd/slackware.com ``` + +'-tags=netcgo' makes DNS resolution much more reliable by using the +systems native DNS resolver. diff --git a/internal/slackware_com/mirror.go b/internal/slackware_com/mirror.go index f3bb4a8..bc1549e 100644 --- a/internal/slackware_com/mirror.go +++ b/internal/slackware_com/mirror.go @@ -2,11 +2,9 @@ package slackware_com import ( "bytes" - "context" "fmt" "hash" "io" - "net" "net/http" "net/url" "path" @@ -22,13 +20,6 @@ type Mirror struct { } func OpenMirror(mirrorURL *url.URL) (*Mirror, error) { - var zeroDialer net.Dialer - transport := http.DefaultTransport.(*http.Transport).Clone() - transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) { - return zeroDialer.DialContext(ctx, "tcp4", addr) - } - http.DefaultClient.Transport = transport - mirror := Mirror{ client: http.DefaultClient, url: mirrorURL, |