aboutsummaryrefslogblamecommitdiffstats
path: root/plumbing/transport/client/example_test.go
blob: e1b3887648dc069cd337d56a1f5b5a5415ffd54d (plain) (tree)
1
2
3
4
5
6
7
8





                    

                                                                     












                                                                               
package client_test

import (
	"crypto/tls"
	"net/http"

	"github.com/go-git/go-git/v5/plumbing/transport/client"
	githttp "github.com/go-git/go-git/v5/plumbing/transport/http"
)

func ExampleInstallProtocol() {
	// Create custom net/http client that.
	httpClient := &http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		},
	}

	// Install it as default client for https URLs.
	client.InstallProtocol("https", githttp.NewClient(httpClient))
}