@@ -7,9 +7,8 @@ package github
77
88import (
99 "context"
10- "fmt"
11-
1210 "encoding/json"
11+ "fmt"
1312)
1413
1514// RepositoryListForksOptions specifies the optional parameters to the
@@ -53,9 +52,9 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string,
5352// RepositoriesService.CreateFork method.
5453type RepositoryCreateForkOptions struct {
5554 // The organization to fork the repository into.
56- Organization string `url :"organization,omitempty"`
57- Name string `url :"name,omitempty"`
58- DefaultBranchOnly bool `url :"default_branch_only,omitempty"`
55+ Organization string `json :"organization,omitempty"`
56+ Name string `json :"name,omitempty"`
57+ DefaultBranchOnly bool `json :"default_branch_only,omitempty"`
5958}
6059
6160// CreateFork creates a fork of the specified repository.
@@ -70,12 +69,8 @@ type RepositoryCreateForkOptions struct {
7069// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork
7170func (s * RepositoriesService ) CreateFork (ctx context.Context , owner , repo string , opts * RepositoryCreateForkOptions ) (* Repository , * Response , error ) {
7271 u := fmt .Sprintf ("repos/%v/%v/forks" , owner , repo )
73- u , err := addOptions (u , opts )
74- if err != nil {
75- return nil , nil , err
76- }
7772
78- req , err := s .client .NewRequest ("POST" , u , nil )
73+ req , err := s .client .NewRequest ("POST" , u , opts )
7974 if err != nil {
8075 return nil , nil , err
8176 }
0 commit comments