5f4f1f7508
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
1.9 KiB
1.9 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| go_build_binary | function | go | infra | 1.0.0 | impure | func GoBuildBinary(projectDir, outputPath string, ldflags string, tags string) error | Compila un binario Go desde un directorio de proyecto. Si ldflags está vacío usa -s -w (strip debug). Si outputPath está vacío usa build/{dirname} dentro del projectDir. Ejecuta con CGO_ENABLED=0. |
|
false | error_go_core |
|
|
nil si la compilacion fue exitosa, error en caso contrario | true |
|
functions/infra/go_build_binary_test.go | functions/infra/go_build_binary.go |
Ejemplo
// Compilar con opciones por defecto
err := GoBuildBinary("/home/user/apps/myapp", "", "", "")
// genera /home/user/apps/myapp/build/myapp
// Compilar con output y tags explícitos
err = GoBuildBinary("/home/user/apps/myapp", "/tmp/myapp-bin", "-s -w -X main.version=1.0", "fts5")
if err != nil {
log.Fatal(err)
}
Notas
Usa CGO_ENABLED=0 para binarios estáticos compatibles con imágenes alpine. El flag -trimpath elimina rutas absolutas del binario para reproducibilidad. Los flags -s -w reducen el tamaño eliminando información de debug y la tabla de símbolos. Compatible con el flujo deploy_app que genera Dockerfile multi-stage.