Refactor prefix search

This commit is contained in:
Mikhail Klementev 2019-05-12 00:11:09 +00:00
parent 660c8a5dba
commit bb5a352215
No known key found for this signature in database
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:])
} }
} }