Files
renovate/lib/modules/datasource/go/schema.ts
Felipe Santos feeb23667c fix(datasource/go): resolve sourceUrl from GOPROXY Origin (#44902)
* fix(datasource/go): resolve sourceUrl from goproxy Origin

Use the Origin field from the existing @latest proxy response so vanity
modules get a sourceUrl without a go-get request to the vanity host.

* Rework some comments

* Update lib/modules/datasource/go/releases-goproxy.spec.ts

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2026-07-28 11:37:43 +00:00

18 lines
530 B
TypeScript

import { z } from 'zod/v4';
import { MaybeTimestamp } from '../../../util/timestamp.ts';
// https://go.dev/ref/mod#goproxy-protocol
export const VersionInfo = z.object({
Version: z.string(),
Time: MaybeTimestamp,
// https://github.com/golang/go/blob/dd612356d8bfe352ec7812ce6c93c9fd2bc10c81/src/cmd/go/internal/modfetch/codehost/codehost.go#L93
Origin: z
.object({
VCS: z.string().optional(),
URL: z.string().optional(),
})
.optional(),
});
export type VersionInfo = z.infer<typeof VersionInfo>;