I am trying to connect to my SlashQL endpoint using Dgo. I’m getting a runtime error within the DialSlashEndpoint() function.
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/dgraph-io/dgo.DialSlashEndpoint(0x9b0f48, 0x34, 0x9ad4d5, 0x2c, 0x9866a0, 0xc00009cd00, 0xc00013fe20)
/home/odet/go/src/github.com/dgraph-io/dgo/client.go:79 +0x387
main.newClient(0xa2d7e0)
I’ve traced the error down to url.Parse and Strings.SplitN in the source. When i reproduce the steps from the code in the DialSlashEndpoint and print the result of u.Host from u = url.parse(“my SlashQL endpoint”) i get no result. this causes String.SplitN to fail because you cant get Array index 1 of nothing. This definitely seems like an issue with the source or with my URL. I will include a fakeURL thats super similar in length and style since im not sure if its safe to share my URL. Sample URL “breakable-lime.us-west-2.aws.cloud.dgraph.io/graphql”
another code sample
client, err := DialSlashEndpoint("breakable-lime.us-west-2.aws.cloud.dgraph.io/graphql", "My-API-SECRET")
if err != nil {
log.Fatal(err)
}