/**
 * GoStrategy - Warm-up strategy for Go projects
 *
 * @see spec.md US-001: Language-Aware Warm-up
 * @satisfies AC-US1-01, AC-US1-02
 */
const MAX_FILES = 10;
/**
 * Get directory from file path (cross-platform)
 */
function getDirectory(filePath) {
    const lastSlash = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\'));
    return lastSlash > 0 ? filePath.substring(0, lastSlash) : filePath;
}
export class GoStrategy {
    constructor(fs) {
        this.language = 'go';
        this.fs = fs;
    }
    async detectProjectRoot(startDir) {
        const goModPath = await this.fs.findUp('go.mod', startDir);
        if (goModPath) {
            this.projectRoot = getDirectory(goModPath);
            return this.projectRoot;
        }
        return null;
    }
    async getFilesToOpen(projectRoot) {
        const files = await this.fs.glob('*.go', projectRoot);
        return files.slice(0, MAX_FILES);
    }
}
//# sourceMappingURL=go.js.map