ValFor converts Facet into types.Val.
(f *api.Facet)
| 175 | |
| 176 | // ValFor converts Facet into types.Val. |
| 177 | func ValFor(f *api.Facet) (types.Val, error) { |
| 178 | val := types.Val{Tid: types.BinaryID, Value: f.Value} |
| 179 | facetTid, err := TypeIDFor(f) |
| 180 | if err != nil { |
| 181 | return types.Val{}, err |
| 182 | } |
| 183 | |
| 184 | return types.Convert(val, facetTid) |
| 185 | } |
no test coverage detected