Skip to content

路由前缀一致导致的冲突问题 #1993

@gitzhang

Description

@gitzhang

我的系统中出现了无法避免的路由前缀一致的情况,请问应该如何处理?
代码片段如下:

pakGroup := router.Group("/pak")
{
	terrainGroup := pakGroup.Group("/terrain")
	{
		terrainGroup.GET("/:layername/layer.json", layerjson)
		terrainGroup.GET("/:layername/:z/:x/:y&f", terrain)
	}
}

错误提示如下:

panic: wildcard route ':z' conflicts with existing children in path '/pak/terrain/:layername/:z/:x/:y&f'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions