@@ -12,6 +12,7 @@ import (
1212 "net/url"
1313 "os"
1414 "runtime"
15+ "strings"
1516
1617 ioaux "github.com/jig/teereadcloser"
1718 "github.com/kballard/go-shellquote"
@@ -371,18 +372,19 @@ func (r *request) curlCmd() (string, error) {
371372 return "" , err
372373 }
373374
374- s := "curl \\ \n "
375+ var s strings.Builder
376+ s .WriteString ("curl \\ \n " )
375377 if r .client .opts .AccessToken != "" {
376- s += fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-H" , "Authorization: token " + r .client .opts .AccessToken ))
378+ s . WriteString ( fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-H" , "Authorization: token " + r .client .opts .AccessToken ) ))
377379 }
378380 // Preserve overrides if Content-Type is set
379381 if r .client .opts .AdditionalHeaders ["Content-Type" ] == "" {
380382 r .client .opts .AdditionalHeaders ["Content-Type" ] = "application/json"
381383 }
382384 for k , v := range r .client .opts .AdditionalHeaders {
383- s += fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-H" , k + ": " + v ))
385+ s . WriteString ( fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-H" , k + ": " + v ) ))
384386 }
385- s += fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-d" , string (data )))
386- s += fmt .Sprintf (" %s" , shellquote .Join (r .client .opts .EndpointURL .JoinPath (".api/graphql" ).String ()))
387- return s , nil
387+ s . WriteString ( fmt .Sprintf (" %s \\ \n " , shellquote .Join ("-d" , string (data ) )))
388+ s . WriteString ( fmt .Sprintf (" %s" , shellquote .Join (r .client .opts .EndpointURL .JoinPath (".api/graphql" ).String () )))
389+ return s . String () , nil
388390}
0 commit comments