Skip to content

Commit ed05dc5

Browse files
committed
update readme.
1 parent 50a608d commit ed05dc5

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ go get github.com/ktrysmt/go-bitbucket
2020

2121
## Usage
2222

23+
create a pullrequest
24+
2325
```go
2426
package main
2527

@@ -30,7 +32,6 @@ import (
3032
)
3133

3234
func main() {
33-
3435
c := bitbucket.NewBasicAuth("username", "password")
3536

3637
opt := &bitbucket.PullRequestsOptions{
@@ -51,6 +52,35 @@ func main() {
5152
}
5253
```
5354

55+
create a repository
56+
57+
```
58+
package main
59+
60+
import (
61+
"fmt"
62+
63+
"github.com/ktrysmt/go-bitbucket"
64+
)
65+
66+
func main() {
67+
c := bitbucket.NewBasicAuth("username", "password")
68+
69+
opt := &bitbucket.RepositoryOptions{
70+
Owner: "project_name",
71+
RepoSlug: "repo_name",
72+
Scm: "git",
73+
}
74+
75+
res, err := c.Repositories.Repository.Create(opt)
76+
if err != nil {
77+
panic(err)
78+
}
79+
80+
fmt.Println(res)
81+
}
82+
```
83+
5484
## FAQ
5585

5686
### Support Bitbucket API v1.0 ?

0 commit comments

Comments
 (0)