---
name: ssh_config_add_entry
kind: function
lang: go
domain: infra
version: "1.0.0"
purity: pure
signature: "func SSHConfigAddEntry(entries []SSHConfigEntry, entry SSHConfigEntry) ([]SSHConfigEntry, error)"
description: "Añade un nuevo SSHConfigEntry a la lista. Error si el alias ya existe."
tags: [ssh, config, add, remote]
uses_functions: []
uses_types: [ssh_config_entry_go_infra]
returns: []
returns_optional: false
error_type: ""
imports: [fmt]
params:
  - name: entries
    desc: "lista actual de SSHConfigEntry"
  - name: entry
    desc: "nuevo entry a añadir con alias unico"
output: "nueva lista con el entry añadido al final"
tested: true
tests: ["añade entry a lista vacia", "añade entry a lista existente", "error si alias duplicado"]
test_file_path: "functions/infra/ssh_config_parse_test.go"
file_path: "functions/infra/ssh_config_add_entry.go"
---

## Ejemplo

```go
newEntry := SSHConfigEntry{Alias: "staging", HostName: "10.0.0.2", User: "deploy"}
updated, err := SSHConfigAddEntry(entries, newEntry)
```

## Notas

No muta el slice original — crea una copia nueva. La validacion de unicidad es por alias exacto.
