func (d *VirDomain) GetName() (string, error) { name := C.virDomainGetName(d.ptr) if name == nil { return "", errors.New(GetLastError()) } return C.GoString(name), nil }
func (d *Domain) GetName() (string, error) { result := C.virDomainGetName(d.cptr) if result == nil { return "", GetLastError() } name := C.GoString(result) return name, nil }
// Name gets the public name for that domain. func (dom Domain) Name() (string, error) { dom.log.Println("reading domain name...") cName := C.virDomainGetName(dom.virDomain) if cName == nil { err := LastError() dom.log.Printf("an error occurred: %v\n", err) return "", err } name := C.GoString(cName) dom.log.Printf("domain name: %v\n", name) return name, nil }