Skip to content
Snippets Groups Projects
Unverified Commit acdd430c authored by Rhys Arkins's avatar Rhys Arkins
Browse files

chore(gomod): better update failure logging

parent 53e3deb7
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,11 @@ export function updateDependency({ ...@@ -28,6 +28,11 @@ export function updateDependency({
} }
const depNameNoVersion = getDepNameWithNoVersion(depName); const depNameNoVersion = getDepNameWithNoVersion(depName);
const lines = fileContent.split(newlineRegex); const lines = fileContent.split(newlineRegex);
// istanbul ignore if: hard to test
if (lines.length <= upgrade.managerData.lineNumber) {
logger.warn('go.mod current line no longer exists after update');
return null;
}
const lineToChange = lines[upgrade.managerData.lineNumber]; const lineToChange = lines[upgrade.managerData.lineNumber];
if ( if (
!lineToChange.includes(depNameNoVersion) && !lineToChange.includes(depNameNoVersion) &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment