You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: edgegroup_list.go
    path of file: ./repos/portainer/api/http/handler/edgegroups
    
    the code of the file until where you have to start completion: package edgegroups

import (
	"fmt"
	"net/http"
	"slices"

	portainer "github.com/portainer/portainer/api"
	"github.com/portainer/portainer/api/dataservices"
	httper
    
func (handler *Handler) edgeGroupList(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
	var decoratedEdgeGroups []decoratedEdgeGroup
	var err error

	err = handler.DataStore.ViewTx(func(tx dataservices.DataStoreTx) error {
		decoratedEdgeGroups, err = getEdgeGroupList(tx)
		return err
	})

	return txResponse(w, decoratedEdgeGroups, err)
}