How do i get the URL parameters with Netlify functions for go?

I’m using netlify functions for an API. Most of which is working perfectly fine, apart from when I am needing to access URL parameters

Here is a snippet of what i have to get the parameter:

func Handler(ctx context.Context, request events.APIGatewayProxyRequest) (Response, error) {
	
    id := request.PathParameters["id"]
	
    ...
}

func main() {
	lambda.Start(Handler)
}

I have other functions that are working correctly that do not require URL params but cannot figure out how to get these ones working, I have tried multiple different selections:

https://example.com/endpoint/1
https://example.com/endpoint/id=1
https://example.com/endpoint?id=1

None of the above return the id path parameter when hitting the endpoint

The answer to this is to use QueryStringParameters. Not sure why PathParameters doesn’t work, but the latter does with the following endpoint:

https://example.com/endpoint?id=1
request.QueryStringParameters["id"]

Good catch, @clarke94! PathParameters are indeed different from QueryStringParameters. I’m not sure what the shape of the PathParameters is, but it’s probably not a key/value pair like the QueryStringParameters. In any case, glad you figured it out.