package main func GetAllHosts() (hosts []Host) { DB.Find(&hosts) return } func CreateHost(hostname string) bool { host := Host{} host.Hostname = hostname result := DB.Create(&host) // TODO: Handle errors if result.Error != nil { return false } return true }