Skip to content

Instantly share code, notes, and snippets.

@ORESoftware
Last active October 29, 2018 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ORESoftware/894438aee1d16aa9b2cb12ba25df274e to your computer and use it in GitHub Desktop.
Save ORESoftware/894438aee1d16aa9b2cb12ba25df274e to your computer and use it in GitHub Desktop.
cannot return non-expression? Cannot return a type/struct?
package models
// note we get a compilation error, shown below
import (
nearby "huru/models/nearby"
person "huru/models/person"
share "huru/models/share"
)
func getModels() struct{} {
return struct {
Near nearby.Map
Pers person.Map
Shar share.Map
}
}
// compilation error:
// type struct { Near nearby.Map; Pers person.Map; Shar share.Map } is not an expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment