/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
example/httpserver/response_with_json_array/controller.go
34 строки
449 B
houseme
add golangci feature to guarantee codes quality (#2229)
01 ноя 2022, 15:12
Не верифицирован
01 ноя 2022, 15:12
1793bf0
Код
Авторство
О чём код?
package main import ( "context" "github.com/gogf/gf/v2/frame/g" ) type Req struct { g.Meta `path:"/user" method:"get"` } type Res []Item type Item struct { Id int64 Name string } var ( User = cUser{} ) type cUser struct{} func (c *cUser) GetList(ctx context.Context, req *Req) (res *Res, err error) { res = &Res{ {Id: 1, Name: "john"}, {Id: 2, Name: "smith"}, {Id: 3, Name: "alice"}, {Id: 4, Name: "katyusha"}, } return }