@@ -533,6 +533,11 @@ function buildGoModulePath(name: string, major: number): string {
533533 return `${ name . replace ( / \/ v \d + $ / , "" ) } /v${ major } ` ;
534534}
535535
536+ // TODO: maybe include pseudo-versions with --prerelease
537+ function isGoPseudoVersion(version: string): boolean {
538+ return / \d{ 14 } - [ 0 - 9 a - f ] { 12 } $/.test(version);
539+ }
540+
536541function parseGoMod ( content : string ) : Record < string , string > {
537542 const deps : Record < string , string > = { } ;
538543 const lines = content . split ( / \r ? \n / ) ;
@@ -1114,7 +1119,7 @@ function findNewVersion(data: any, {mode, range, useGreatest, useRel, usePre, se
11141119
11151120 // Check cross-major upgrade
11161121 const crossVersion = coerceToVersion ( data . new ) ;
1117- if ( crossVersion ) {
1122+ if ( crossVersion && ! isGoPseudoVersion ( data . new ) ) {
11181123 const d = diff ( oldVersion , crossVersion ) ;
11191124 if ( d && semvers . has ( d ) ) {
11201125 return data . new ;
@@ -1123,7 +1128,7 @@ function findNewVersion(data: any, {mode, range, useGreatest, useRel, usePre, se
11231128
11241129 // Fall back to same-major upgrade
11251130 const sameVersion = coerceToVersion ( data . sameMajorNew ) ;
1126- if ( sameVersion ) {
1131+ if ( sameVersion && ! isGoPseudoVersion ( data . sameMajorNew ) ) {
11271132 const d = diff ( oldVersion , sameVersion ) ;
11281133 if ( d && semvers . has ( d ) ) {
11291134 data . Time = data . sameMajorTime ;
0 commit comments