Skip to content

Commit

Permalink
Ajout verif duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
bakraw committed May 2, 2024
1 parent e830c72 commit 6a1f432
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mikromap-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ func addRouter() {
// Ajout d'un nouveau routeur dans routers.json
dataR := readJSON()

for _, v := range dataR {
if v.IP == addrIP {
log.Fatal("--- Erreur: cette adresse IP existe déjà.")
}
}

newRouter := Router{
IP: addrIP,
Lat: lat,
Expand Down

0 comments on commit 6a1f432

Please sign in to comment.