snyk-go-plugin
Version:
Snyk CLI Golang plugin
14 lines (13 loc) • 610 B
TypeScript
/**
* Determine the Go tool-chain version (e.g. "1.22.2") to be used
* as a surrogate version for standard-library packages.
*
* 1. Looks for a `toolchain goX.Y.Z` directive in `go.mod`.
* 2. Falls back to the `go version` output when the directive is absent.
*
* Returns the version **without** the leading `go` prefix or
* the string `unknown` when the version cannot be resolved.
*/
export declare function resolveStdlibVersion(root: string, targetFile: string): Promise<string>;
export declare function jsonParse<T = any>(s: string): T;
export declare function pathToPosix(fpath: string): string;