gf icon indicating copy to clipboard operation
gf copied to clipboard

github.com/gogf/gf/v2/frame/g cannot get instance

Open YoungBoyGod opened this issue 1 year ago • 1 comments

Go version

go 1.22.4 amd64

GoFrame version

2.7.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

i want to get client instance,but get null.

test one: ` package gerritLogicV1

import ( "HaiTangOps/internal/model/gerritModelV1" "HaiTangOps/internal/service" "context" //"github.com/andygrunwald/go-gerrit" "github.com/gogf/gf/v2/frame/g" "golang.org/x/build/gerrit" )

type sGerritV1 struct{}

func New() *sGerritV1 { return &sGerritV1{} }

func init() { service.RegisterGerritV1(New()) } func (s *sGerritV1) GetGerritInstance(ctx context.Context, input *gerritModelV1.GetGerritInstanceInput) (output *gerrit.Client) { // todo 需要增加登录gerrit 的功能模块 g.Log().Debug(context.Background(), "input", input) // 1.输入地址,用户名密码 client := gerrit.NewClient(input.Url, gerrit.BasicAuth(input.Username, input.Password)) g.Log("gerrit").Debug(ctx, "output", client) return client

}

2024-07-23 20:49:34.763 [DEBU] input {"Username":"aadmin","Password":"admin","Url":"http://192.168.10.211:8080"} 2024-07-23 20:49:34.763 [DEBU] {bc25aeb279d8e41780d46416e24a9e43} output {"HTTPClient":null} 2024-07-23 20:49:34.763 [INFO] {bc25aeb279d8e41780d46416e24a9e43} {"HTTPClient":null} ` test two: image

What did you see happen?

i donnt kown why i cannot get client instance use gf i try use gin ,it is ok。 so what is wrong ?

What did you expect to see?

i want get the instance in gf image

YoungBoyGod avatar Jul 23 '24 12:07 YoungBoyGod

image it seem run to a loop

YoungBoyGod avatar Jul 24 '24 03:07 YoungBoyGod

似乎你并没有使用到 gf 的某个组件?

oldme-git avatar Sep 23 '24 08:09 oldme-git

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It seems that you are not using a component of gf?

Issues-translate-bot avatar Sep 23 '24 08:09 Issues-translate-bot

@YoungBoyGod 根据你的描述,该问题和gerrit包有关,建议咨询其开源项目。

gqcn avatar Oct 05 '24 12:10 gqcn

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@YoungBoyGod According to your description, this problem is related to the gerrit package. It is recommended to consult its open source project.

Issues-translate-bot avatar Oct 05 '24 12:10 Issues-translate-bot