@@ -43,12 +43,6 @@ const (
4343 release = "release"
4444)
4545
46- // GitHubClientFactory type for creating a GitHubClient.
47- type GitHubClientFactory func (token string , repo * github.Repository ) (GitHubClient , error )
48-
49- // ContainerClientFactory type for creating a ContainerClient.
50- type ContainerClientFactory func (workRoot , image , userUID , userGID string ) (ContainerClient , error )
51-
5246type commitInfo struct {
5347 cfg * config.Config
5448 state * config.LibrarianState
@@ -73,20 +67,7 @@ type commandRunner struct {
7367
7468const defaultAPISourceBranch = "master"
7569
76- func newCommandRunner (cfg * config.Config , ghClientFactory GitHubClientFactory , containerClientFactory ContainerClientFactory ) (* commandRunner , error ) {
77- // If no GitHub client factory is provided, use the default one.
78- if ghClientFactory == nil {
79- ghClientFactory = func (token string , repo * github.Repository ) (GitHubClient , error ) {
80- return github .NewClient (token , repo )
81- }
82- }
83- // If no container client factory is provided, use the default one.
84- if containerClientFactory == nil {
85- containerClientFactory = func (workRoot , image , userUID , userGID string ) (ContainerClient , error ) {
86- return docker .New (workRoot , image , userUID , userGID )
87- }
88- }
89-
70+ func newCommandRunner (cfg * config.Config ) (* commandRunner , error ) {
9071 if cfg .APISource == "" {
9172 cfg .APISource = "https://github.com/googleapis/googleapis"
9273 }
@@ -129,12 +110,12 @@ func newCommandRunner(cfg *config.Config, ghClientFactory GitHubClientFactory, c
129110 return nil , fmt .Errorf ("failed to get GitHub repo from remote: %w" , err )
130111 }
131112 }
132- ghClient , err := ghClientFactory (cfg .GitHubToken , gitRepo )
113+ ghClient , err := github . NewClient (cfg .GitHubToken , gitRepo )
133114 if err != nil {
134115 return nil , fmt .Errorf ("failed to create GitHub client: %w" , err )
135116 }
136117
137- container , err := containerClientFactory (cfg .WorkRoot , image , cfg .UserUID , cfg .UserGID )
118+ container , err := docker . New (cfg .WorkRoot , image , cfg .UserUID , cfg .UserGID )
138119 if err != nil {
139120 return nil , err
140121 }
0 commit comments