Don't actually hit dl site
continuous-integration/drone/pr Build is passing Details

Signed-off-by: jolheiser <john.olheiser@gmail.com>
pull/1/head
jolheiser 2021-08-08 22:04:43 -05:00
parent 4d2af9ae20
commit c019ab570b
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 2 additions and 2 deletions

2
dl.go
View File

@ -6,7 +6,7 @@ import (
"net/http" "net/http"
) )
const dlURL = "https://golang.org/dl/?mode=json" var dlURL = "https://golang.org/dl/?mode=json"
// Version is a Go version // Version is a Go version
type Version struct { type Version struct {

View File

@ -14,7 +14,7 @@ func TestVersions(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write(dlResp) _, _ = w.Write(dlResp)
})) }))
http.DefaultClient = server.Client() dlURL = server.URL
versions, err := Versions(context.Background()) versions, err := Versions(context.Background())
if err != nil { if err != nil {