diff options
author | ferhat elmas <elmas.ferhat@gmail.com> | 2016-11-15 01:18:53 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-11-15 01:18:53 +0100 |
commit | 16d86605732ba3198c0acd4317b53cf4991a7d4d (patch) | |
tree | 3306f0438235f7dfe19fd37c5393a4794abe0535 /doc.go | |
parent | eb89d2dd9a36440d58aea224c055b364e49785f7 (diff) | |
download | go-git-16d86605732ba3198c0acd4317b53cf4991a7d4d.tar.gz |
Add configurable http client factory (fixes #120) (#121)
* new http client factory ready to install/override default http(s)
* mv GitUploadPackServiceFactory to clients.common pkg
* rename http.HTTPError to http.Err
* rename http.HTTPAuthMethod to http.AuthMethod
* add doc and examples/ usage
* general improvements:
- update install link in readme to v4 (example are already pointing v4)
- fix indentation in package doc (styling for godoc.org)
- use http.Status constants instead of integers
- close leaked response body
- rm named returns which stutter in doc
- fix one format string
- rm unnecessary if checks
- documentation fixes
Diffstat (limited to 'doc.go')
-rw-r--r-- | doc.go | 49 |
1 files changed, 25 insertions, 24 deletions
@@ -6,31 +6,32 @@ // extensions. // // Small example extracting the commits from a repository: -// func ExampleBasic_printCommits() { -// r := git.NewMemoryRepository() -// o := &git.CloneOptions{ -// URL: "https://github.com/src-d/go-git", -// } -// if err := r.Clone(o); err != nil { -// panic(err) -// } // -// iter, err := r.Commits() -// if err != nil { -// panic(err) -// } -// defer iter.Close() +// func ExampleBasic_printCommits() { +// r := git.NewMemoryRepository() +// o := &git.CloneOptions{ +// URL: "https://github.com/src-d/go-git", +// } +// if err := r.Clone(o); err != nil { +// panic(err) +// } // -// for { -// commit, err := iter.Next() -// if err != nil { -// if err == io.EOF { -// break -// } -// panic(err) -// } +// iter, err := r.Commits() +// if err != nil { +// panic(err) +// } +// defer iter.Close() // -// fmt.Println(commit) -// } -// } +// for { +// commit, err := iter.Next() +// if err != nil { +// if err == io.EOF { +// break +// } +// panic(err) +// } +// +// fmt.Println(commit) +// } +// } package git // import "gopkg.in/src-d/go-git.v4" |