File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,10 +120,7 @@ Examples:
120120// gqlURL returns the URL to the GraphQL endpoint for the given Sourcegraph
121121// instance.
122122func gqlURL (endpoint string ) string {
123- if ! strings .HasSuffix (endpoint , "/" ) {
124- endpoint = endpoint + "/"
125- }
126- return endpoint + ".api/graphql"
123+ return endpoint + "/.api/graphql"
127124}
128125
129126// curlCmd returns the curl command to perform the given GraphQL query. Bash-only.
Original file line number Diff line number Diff line change 99 "os"
1010 "os/user"
1111 "path/filepath"
12+ "strings"
1213)
1314
1415const usageText = `src is a tool that provides access to Sourcegraph instances.
@@ -85,7 +86,7 @@ func readConfig() (*config, error) {
8586 cfg .AccessToken = envToken
8687 }
8788 if * endpoint != "" {
88- cfg .Endpoint = * endpoint
89+ cfg .Endpoint = strings . TrimSuffix ( * endpoint , "/" )
8990 }
9091 if cfg .Endpoint == "" {
9192 cfg .Endpoint = "https://sourcegraph.com"
You can’t perform that action at this time.
0 commit comments