This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/pkg/api/groups.go

15 lines
368 B
Go

package api
import (
"context"
"github.com/mentos1386/golang-rest-example/pkg/openapi"
)
func (u *ApiService) GroupsGet(ctx context.Context) ([]openapi.Group, error) {
var groups []openapi.Group
for _, group := range u.groups {
groups = append(groups, *group)
}
groups = append(groups, openapi.Group{ID: openapi.ID(1), Name: "Admins"})
return groups, nil
}