diff --git a/search/search.go b/search/search.go index 3d19124..c24f49b 100644 --- a/search/search.go +++ b/search/search.go @@ -55,6 +55,10 @@ func SearchGraph(apiEndpoint, fixToken, workspaceID, searchStr string, withEdges } scanner := bufio.NewScanner(resp.Body) + const maxTokenSize = 1024 * 1024 + buf := make([]byte, maxTokenSize) + scanner.Buffer(buf, maxTokenSize) + for scanner.Scan() { var result interface{} if err := json.Unmarshal(scanner.Bytes(), &result); err != nil {