squirrel
squirrel copied to clipboard
add support for slice to the Expr
This code allows to get an slice of parameters in an expression
Could you show an example of where this would be helpful?
@lann here the usage : https://github.com/rande/gonode/blob/master/extra/goji.go#L129
This feature help me to expand the parameters from the Form struct into valid parameters.
Another solution will be to open the args
attributes in the Expr structure
Go itself generally doesn't hide the complexity of e.g. copying a []string to an []interface{} , and I'm inclined to take the same approach here, especially since you can't generalize it for all slice types (beyond the string/int you have here) without reflection.
Given that you only need to use []string's here, would it make sense to just have an e.g. stringsToIfaces helper func?
Unfortunately I will not be able to review or merge major changes for the forseeable future; see README.
Lann has moved Squirrel to the Masterminds project, and is still the architect, but @mattfarina and I will be helping him maintain. We'll start reviewing pull requests and see if we can get this in.
Another use case - PostgreSQL array intersection:
squirrel.Expr("tags && ?", tagSlice)