feat: add bash pipeline functions for Go project initialization
2 pipelines Bash: init_go_module (inicializa un modulo Go con go mod init y estructura de directorios estandar) e init_go_project (scaffolding completo de proyecto Go con cmd/, internal/, configs y Makefile). Componen funciones shell existentes del registry.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: init_go_module
|
||||
kind: pipeline
|
||||
lang: bash
|
||||
domain: pipelines
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "init_go_module([module_path: string]) -> void"
|
||||
description: "Pipeline que inicializa un módulo Go simple en el directorio actual. Crea go.mod (go mod init), main.go con hello world, .gitignore, build.sh (cross-compilation linux/windows/all) y dev.sh para ejecución rápida."
|
||||
tags: [bash, go, module, init, scaffold, launcher]
|
||||
uses_functions: [install_go_bash_infra, assert_command_exists_bash_shell]
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
params:
|
||||
- name: module_path
|
||||
desc: "path del módulo Go, ej: github.com/user/mymodule (default: github.com/user/<dirname>)"
|
||||
output: "crea archivos en el directorio actual y muestra progreso; exit code 1 si Go no está instalado o go mod init falla"
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "bash/functions/pipelines/init_go_module.sh"
|
||||
source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git"
|
||||
source_license: "MIT"
|
||||
source_file: "scripts/linux/inicializar_repos/go/init_go_module.sh"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
mkdir mi-modulo && cd mi-modulo
|
||||
|
||||
# Con module_path automático (github.com/user/mi-modulo)
|
||||
bash bash/functions/pipelines/init_go_module.sh
|
||||
|
||||
# Con module_path explícito
|
||||
bash bash/functions/pipelines/init_go_module.sh github.com/miorg/mi-modulo
|
||||
|
||||
# Ejecutar tras crear
|
||||
./dev.sh
|
||||
./build.sh
|
||||
./build.sh all
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Crea un módulo minimalista (main.go simple + build tools). Para proyectos con estructura profesional (cmd/, internal/, pkg/) usar `init_go_project`. No inicializa git — añadido manualmente o via gitea_init_app.
|
||||
Reference in New Issue
Block a user