| 1 |
package client_test |
| 2 |
|
| 3 |
import ( |
| 4 |
"crypto/tls" |
| 5 |
"net/http" |
| 6 |
|
| 7 |
"github.com/go-git/go-git/v5/plumbing/transport/client" |
| 8 |
githttp "github.com/go-git/go-git/v5/plumbing/transport/http" |
| 9 |
) |
| 10 |
|
| 11 |
func ExampleInstallProtocol() { |
| 12 |
// Create custom net/http client that. |
| 13 |
httpClient := &http.Client{ |
| 14 |
Transport: &http.Transport{ |
| 15 |
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
| 16 |
}, |
| 17 |
} |
| 18 |
|
| 19 |
// Install it as default client for https URLs. |
| 20 |
client.InstallProtocol("https", githttp.NewClient(httpClient)) |
| 21 |
} |