func autocompleteSystems(db evego.Database, search string) *[]evego.SolarSystem { // Use make to ensure that we actually have a slice rather than just a nil // pointer. results := make([]evego.SolarSystem, 0, 5) log.Printf("searching %v\n", search) systems, _ := db.SolarSystemsForPattern(search + "%") for i, s := range systems { if i >= 10 { break } results = append(results, s) } return &results }