Skip to content
Gx
GitHub

GX3004: duplicate route pattern

Two route types have the same method and pattern.

Cause

Two route types have the same method and pattern. The router can send a request to one of them only.

Example

shop/route/route.go
package route

import "github.com/alternayte/gx"

type Home struct {
	gx.Route `GET /shop`
}

type List struct {
	gx.Route `GET /shop`
}

gx check reports:

gx check
shop/route/route.go:9:6: GX3004: pattern "GET /shop" is already used by "Home"

Fix

  1. Change the pattern of one route type.
  2. Or remove one of the two types.