@@ -101,7 +101,7 @@ type ContainerClient interface {
101101type commitInfo struct {
102102 // branch is the base branch of the created pull request.
103103 branch string
104- // commit declares whether or not to create a commit.
104+ // commit declares whether to create a commit.
105105 commit bool
106106 // commitMessage is used as the message on the actual git commit.
107107 commitMessage string
@@ -111,7 +111,7 @@ type commitInfo struct {
111111 prType pullRequestType
112112 // pullRequestLabels is a list of labels to add to the created pull request.
113113 pullRequestLabels []string
114- // push declares whether or not to push the commits to GitHub.
114+ // push declares whether to push the commits to GitHub.
115115 push bool
116116 // languageRepo is the git repository containing the language-specific libraries.
117117 languageRepo gitrepo.Repository
@@ -129,7 +129,7 @@ type commitInfo struct {
129129 library string
130130 // prBodyBuilder is a callback function for building the pull request body
131131 prBodyBuilder func () (string , error )
132- // isDraft declares whether or not to create the pull request as a draft.
132+ // isDraft declares whether to create the pull request as a draft.
133133 isDraft bool
134134}
135135
@@ -269,18 +269,6 @@ func findLibraryIDByAPIPath(state *config.LibrarianState, apiPath string) string
269269 return ""
270270}
271271
272- func findLibraryByID (state * config.LibrarianState , libraryID string ) * config.LibraryState {
273- if state == nil {
274- return nil
275- }
276- for _ , lib := range state .Libraries {
277- if lib .ID == libraryID {
278- return lib
279- }
280- }
281- return nil
282- }
283-
284272func formatTimestamp (t time.Time ) string {
285273 const yyyyMMddHHmmss = "20060102T150405Z" // Expected format by time library
286274 return t .Format (yyyyMMddHHmmss )
@@ -289,7 +277,7 @@ func formatTimestamp(t time.Time) string {
289277// cleanAndCopyLibrary cleans the files of the given library in repoDir and copies
290278// the new files from outputDir.
291279func cleanAndCopyLibrary (state * config.LibrarianState , repoDir , libraryID , outputDir string ) error {
292- library := findLibraryByID ( state , libraryID )
280+ library := state . LibraryByID ( libraryID )
293281 if library == nil {
294282 return fmt .Errorf ("library %q not found during clean and copy, despite being found in earlier steps" , libraryID )
295283 }
@@ -320,7 +308,7 @@ func cleanAndCopyLibrary(state *config.LibrarianState, repoDir, libraryID, outpu
320308// If a file is being copied to the library's SourceRoots in the dest folder but the folder does
321309// not exist, the copy fails.
322310func copyLibraryFiles (state * config.LibrarianState , dest , libraryID , src string ) error {
323- library := findLibraryByID ( state , libraryID )
311+ library := state . LibraryByID ( libraryID )
324312 if library == nil {
325313 return fmt .Errorf ("library %q not found" , libraryID )
326314 }
0 commit comments