88 "errors"
99 "fmt"
1010 "net/http"
11+ "slices"
1112
1213 "github.com/ScrapeGraphAI/scrapegraphai-go/internal/apijson"
1314 "github.com/ScrapeGraphAI/scrapegraphai-go/internal/requestconfig"
@@ -38,15 +39,15 @@ func NewSmartscraperService(opts ...option.RequestOption) (r SmartscraperService
3839// Main scraping endpoint with LLM-powered content analysis. Supports various
3940// fetching providers, infinite scrolling, pagination, and custom output schemas.
4041func (r * SmartscraperService ) New (ctx context.Context , body SmartscraperNewParams , opts ... option.RequestOption ) (res * CompletedSmartscraper , err error ) {
41- opts = append (r .Options [:] , opts ... )
42+ opts = slices . Concat (r .Options , opts )
4243 path := "smartscraper"
4344 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
4445 return
4546}
4647
4748// Retrieve the status and results of a scraping operation
4849func (r * SmartscraperService ) Get (ctx context.Context , requestID string , opts ... option.RequestOption ) (res * SmartscraperGetResponseUnion , err error ) {
49- opts = append (r .Options [:] , opts ... )
50+ opts = slices . Concat (r .Options , opts )
5051 if requestID == "" {
5152 err = errors .New ("missing required request_id parameter" )
5253 return
@@ -58,7 +59,7 @@ func (r *SmartscraperService) Get(ctx context.Context, requestID string, opts ..
5859
5960// Retrieve the status and results of a scraping operation
6061func (r * SmartscraperService ) List (ctx context.Context , opts ... option.RequestOption ) (res * SmartscraperListResponseUnion , err error ) {
61- opts = append (r .Options [:] , opts ... )
62+ opts = slices . Concat (r .Options , opts )
6263 path := "smartscraper"
6364 err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & res , opts ... )
6465 return
0 commit comments