diff options
author | joe <rbo@gmx.us> | 2025-08-26 19:24:18 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-08-26 19:24:18 +0200 |
commit | 93aed08e521c7d96d3c53f207fb650b449cdb12c (patch) | |
tree | d3bf429138004692a36a4a47df137093f1393fc2 /src/i_insert.go | |
parent | fixed (diff) | |
download | hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.gz hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.bz2 hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.xz hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.zst hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.zip |
fixed all errs and some other things
Diffstat (limited to '')
-rw-r--r-- | src/i_insert.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/i_insert.go b/src/i_insert.go index 79d46e6..a147cb3 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -211,9 +211,10 @@ func i_insert_check_ok(data *HardData, in *HostNode) { if len(in.Host) == 0 { if (in.Protocol == PROTOCOL_RDP && len(in.RDPFile) > 0) == false { text := "no host" - if in.Protocol == PROTOCOL_CMD { + switch in.Protocol { + case PROTOCOL_CMD: text = "no command" - } else if in.Protocol == PROTOCOL_OS { + case PROTOCOL_OS: text = "no endpoint" } data.insert_err = append(data.insert_err, errors.New(text)) @@ -326,7 +327,7 @@ func i_draw_text_box(ui *HardUI, line int, dim Quad, label, content string, tbox_style = tbox_style.Foreground(tcell.ColorRed) } spaces := "" - for i := 0; i < tbox_size; i++ { + for range tbox_size { spaces += " " } i_draw_text(ui.s, ui.dim[W] / 2, line, dim.R, line, @@ -348,11 +349,11 @@ func i_draw_ok_butt(ui *HardUI, dim Quad, line, id, selected int) { style = style.Reverse(true).Dim(false) } buff := "[" - for i := 0; i < butt_size / 2 - len(txt); i++ { + for range butt_size / 2 - len(txt) { buff += " " } buff += txt - for i := 0; i < butt_size / 2 - len(txt); i++ { + for range butt_size / 2 - len(txt) { buff += " " } buff += "]" |