mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-06-03 20:12:58 +00:00
14 lines
302 B
Go
14 lines
302 B
Go
package api
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
// firstPathParam returns the first non-empty route param from the provided names.
|
|
func firstPathParam(c *gin.Context, names ...string) string {
|
|
for _, name := range names {
|
|
if value := c.Param(name); value != "" {
|
|
return value
|
|
}
|
|
}
|
|
return ""
|
|
}
|