Skip to content

Commit

Permalink
AlexisVisco review
Browse files Browse the repository at this point in the history
  • Loading branch information
eskombro committed Jun 12, 2020
1 parent 45d36c4 commit 3b0cbec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions client_documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type docTest struct {
}

type docTestBooks struct {
Book_id int `json:"book_id"`
Title string `json:"title"`
Tag string `json:"tag"`
BookId int `json:"book_id"`
Title string `json:"title"`
Tag string `json:"tag"`
}

func TestClientDocuments_Get(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions client_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c clientSearch) Search(request SearchRequest) (*SearchResponse, error) {
values.Add("matches", strconv.FormatBool(request.Matches))
}
if len(request.FacetsDistribution) != 0 {
values.Add("facetsDistribution", fmt.Sprintf("[\"%s\"]", strings.Join(request.FacetsDistribution, "\",\"")))
values.Add("facetsDistribution", fmt.Sprintf("[%q]", strings.Join(request.FacetsDistribution, "\",\"")))
}
if request.FacetFilters != nil {
facetFiltersToStr := facetFiltersToStr(request.FacetFilters)
Expand Down Expand Up @@ -91,15 +91,15 @@ func facetFiltersToStr(i interface{}) string {
case []string:
for _, slice := range v {
stringSlice := slice
facetsToStr += fmt.Sprintf("\"%s\",", stringSlice)
facetsToStr += fmt.Sprintf("%q,", stringSlice)
}
facetsToStr = fmt.Sprintf("[%s]", facetsToStr[:len(facetsToStr)-1])
case [][]string:
for _, mainSlice := range v {
facetsToStr += "["
for _, slice := range mainSlice {
stringSlice := slice
facetsToStr += fmt.Sprintf("\"%s\",", stringSlice)
facetsToStr += fmt.Sprintf("%q,", stringSlice)
}
facetsToStr = facetsToStr[:len(facetsToStr)-1] + "],"

Expand Down
14 changes: 7 additions & 7 deletions client_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ func TestClientSearch_Search(t *testing.T) {
}

booksTest := []docTestBooks{
{Book_id: 123, Title: "Pride and Prejudice", Tag: "Nice book"},
{Book_id: 456, Title: "Le Petit Prince", Tag: "Nice book"},
{Book_id: 1, Title: "Alice In Wonderland", Tag: "Nice book"},
{Book_id: 1344, Title: "The Hobbit", Tag: "Nice book"},
{Book_id: 4, Title: "Harry Potter and the Half-Blood Prince", Tag: "Interesting book"},
{Book_id: 42, Title: "The Hitchhiker's Guide to the Galaxy", Tag: "Interesting book"},
{Book_id: 24, Title: "You are a princess", Tag: "Interesting book"},
{BookId: 123, Title: "Pride and Prejudice", Tag: "Nice book"},
{BookId: 456, Title: "Le Petit Prince", Tag: "Nice book"},
{BookId: 1, Title: "Alice In Wonderland", Tag: "Nice book"},
{BookId: 1344, Title: "The Hobbit", Tag: "Nice book"},
{BookId: 4, Title: "Harry Potter and the Half-Blood Prince", Tag: "Interesting book"},
{BookId: 42, Title: "The Hitchhiker's Guide to the Galaxy", Tag: "Interesting book"},
{BookId: 24, Title: "You are a princess", Tag: "Interesting book"},
}

updateIDRes, err := client.
Expand Down

0 comments on commit 3b0cbec

Please sign in to comment.