typesense / typesense-go

Go client for Typesense: https://github.com/typesense/typesense
Apache License 2.0
220 stars 56 forks source link

Syntax error #104

Closed billiboy closed 2 years ago

billiboy commented 2 years ago

Description

I am trying the examples as reported in the golang api document but I get this error when I create an index: https://i.imgur.com/t6gQa0m.png

v-byte-cpu commented 2 years ago

Hi @billiboy, you need to replace the true literal with a pointer to bool. We will update readme to reflect the changes in api.

billiboy commented 2 years ago

Hi @billiboy, you need to replace the true literal with a pointer to bool. We will update readme to reflect the changes in api.

give me an example of how I should do? I'm not very practical, I'm still learning go

billiboy commented 2 years ago

Hi @billiboy, you need to replace the true literal with a pointer to bool. We will update readme to reflect the changes in api.

is it okay to do it this way? func BoolPointer(b bool) *bool { return &b }

v-byte-cpu commented 2 years ago

yes, it is fine, you can define this function yourself or use github.com/typesense/typesense-go/tree/master/typesense/api/pointer package: https://github.com/typesense/typesense-go/blob/2db0f91ae0fdb3025708f630d77f0e3d7edc7e68/typesense/api/pointer/pointer.go#L3-L6