Refactor prefix search

This commit is contained in:
dump_stack() 2019-05-12 00:11:09 +00:00
parent 660c8a5dba
commit bb5a352215
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -111,7 +111,7 @@ func list(l *libvirt.Libvirt) {
fmt.Println("Started VM:") fmt.Println("Started VM:")
for _, d := range domains { for _, d := range domains {
if d.Name[0:5] == "appvm" { if strings.HasPrefix(d.Name, "appvm") {
fmt.Println("\t", d.Name[6:]) fmt.Println("\t", d.Name[6:])
} }
} }