mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 02:00:10 +00:00
feeb23667c
* 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>
18 lines
530 B
TypeScript
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>;
|