@@ -83,7 +83,13 @@ export function updateDependency({
8383 // Since the 2024 goproxy datasource changes, newValue and newDigest are
8484 // both extracted from the same proxy version string and always reference
8585 // the same commit, so newValue can be written directly for pseudo-versions.
86- if ( upgrade . newValue ?. startsWith ( 'v0.0.0-' ) ) {
86+ // However, for private modules (GONOPROXY / direct datasource), the proxy
87+ // has no data and newValue may equal currentValue. In that case, fall
88+ // through to the bare hash path so that gomodTidy can resolve it.
89+ if (
90+ upgrade . newValue ?. startsWith ( 'v0.0.0-' ) &&
91+ upgrade . newValue !== upgrade . currentValue
92+ ) {
8793 logger . debug (
8894 { depName : currentName , lineToChange, newValue : upgrade . newValue } ,
8995 'gomod: updating pseudo-version digest' ,
@@ -94,10 +100,10 @@ export function updateDependency({
94100 `$<depPart>$<divider>${ upgrade . newValue } ` ,
95101 ) ;
96102 } else {
97- // Defensive fallback for non-pseudo-version digest updates.
98- // Unreachable for gomod in practice: currentDigest is only extracted
99- // for pseudo-versions, and the gomod override in lookup/index.ts that
100- // sets updateType='digest' requires newValue to start with 'v0.0.0-' .
103+ // Fallback for private modules where the proxy could not resolve a new
104+ // pseudo-version, or non-pseudo-version digest updates.
105+ // Writes the bare hash so that postUpdateOptions like gomodTidy can
106+ // normalize it into a valid pseudo-version via `go get` .
101107 const newDigestRightSized = upgrade . newDigest ! . substring (
102108 0 ,
103109 upgrade . currentDigest ! . length ,
0 commit comments