Answer the question
In order to leave comments, you need to log in
Is it something wrong with my code or with the router?
Hello. I use the router github.com/julienschmidt/httprouter
Now I made a frame of all routes pastebin.com/x74jrCpz
When compiling it says
[email protected]:~/localhost/api/src/generais$ go run main.go
panic: path segment 'main/:keyApi/:token/:hash' conflicts with existing wildcard ':keyApi' in path '/battleground/main/:keyApi/:token/:hash'
goroutine 1 [running]:
github.com/julienschmidt/httprouter.(*node).addRoute(0x188d5cb0, 0x8485e6e, 0x19, 0x84d0228)
/home/v-smerti/localhost/api/src/github.com/julienschmidt/httprouter/tree.go:153 +0x5ec
github.com/julienschmidt/httprouter.(*Router).Handle(0x188d7fa0, 0x8430bec, 0x3, 0x8485e60, 0x27, 0x84d0228)
/home/v-smerti/localhost/api/src/github.com/julienschmidt/httprouter/router.go:229 +0x1b2
github.com/julienschmidt/httprouter.(*Router).GET(0x188d7fa0, 0x8485e60, 0x27, 0x84d0228)
/home/v-smerti/localhost/api/src/github.com/julienschmidt/httprouter/router.go:173 +0x4a
main.main()
/home/v-smerti/localhost/api/src/generais/main.go:410 +0x535
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_386.s:1662 +0x1
goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0x188f8000)
/usr/lib/go/src/database/sql/sql.go:634 +0x3c
created by database/sql.Open
/usr/lib/go/src/database/sql/sql.go:481 +0x276
exit status 2
Answer the question
In order to leave comments, you need to log in
panic: path segment 'main/:keyApi/:token/:hash' conflicts with existing wildcard ':keyApi' in path '/battleground/main/:keyApi/:token/:hash'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question