Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: remove workspace packages that no longer exist #40690

Closed
leguminosa opened this issue Aug 11, 2020 · 16 comments
Closed

x/tools/gopls: remove workspace packages that no longer exist #40690

leguminosa opened this issue Aug 11, 2020 · 16 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@leguminosa
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13 linux/amd64

Does this issue reproduce with the latest release?

Yes (v0.16.1)

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/nakama/.cache/go-build"
GOENV="/home/nakama/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/nakama/.gvm/pkgsets/go1.13/global"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/nakama/.gvm/gos/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/nakama/.gvm/gos/go1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/nakama/workspace/tokopedia/rechargeapp/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build894095586=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Nothing. The error message pops up frequently out of nowhere, almost randomly without any root cause / action trigger (when I'm changing branch, just moving mouse, or even without doing anything)

What did you expect to see?

Nothing

What did you see instead?

image

@chrisnesbit1
Copy link

+1 I get this error also. Seems to happen everytime I type something in a go file. Every character. Even if I don't save the file. I have the go.buildOnSave setting set to off for User, Remote, Workspace and the folder which I have open in the workspace. But that setting seems to have no effect.

@hyangah hyangah changed the title Error message pop-up "The code in the workspace failed to compile" x/tools/gopls: Error message pop-up "The code in the workspace failed to compile" Aug 11, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Aug 11, 2020
@gopherbot gopherbot added this to the Unreleased milestone Aug 11, 2020
@sioncheng
Copy link

Setting go.useLanguageServer to false will fix the issue for now.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v.0.4.5 Aug 12, 2020
@stamblerre stamblerre changed the title x/tools/gopls: Error message pop-up "The code in the workspace failed to compile" x/tools/gopls: error message pop-up "The code in the workspace failed to compile" Aug 12, 2020
@stamblerre
Copy link
Contributor

@leguminosa, @chrisnesbit1, @sioncheng: Please capture your gopls logs (instructions) and share them here so we can investigate.

@chrisnesbit1
Copy link

welp, today it's not an issue. My computer has gone to sleep since then, but it wasn't a full reboot. perhaps the settings did not go into affect immediately? I can't reproduce the issue atm, but if it starts happening again I will update this ticket with my gopls logs.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 12, 2020
@leguminosa
Copy link
Author

leguminosa commented Aug 13, 2020

@stamblerre here's my gopls log, I got the error again today, thank you.

gopls (server) Output
[Trace - 23:50:15.798 PM] Sending request 'textDocument/codeAction - (6)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"},"range":{"start":{"line":22,"character":3},"end":{"line":22,"character":3}},"context":{"diagnostics":[]}}

[Trace - 23:50:16.539 PM] Received response 'textDocument/codeAction - (6)' in 740ms.
Result: null

[Trace - 23:50:21.540 PM] Sending request 'textDocument/codeAction - (7)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"},"range":{"start":{"line":26,"character":46},"end":{"line":26,"character":46}},"context":{"diagnostics":[]}}

[Trace - 23:50:21.573 PM] Received response 'textDocument/codeAction - (7)' in 33ms.
Result: null

[Trace - 23:50:26.474 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","languageId":"go","version":1,"text":"package bukopin\n\nimport (\n\t"encoding/json"\n\t"errors"\n\t"fmt"\n\t"strings"\n\t"time"\n\n\t"github.com/eapache/go-resiliency/breaker"\n\t"github.com/tokopedia/rechargeapp/internal/constant"\n\t"github.com/tokopedia/rechargeapp/internal/entity"\n\t"github.com/tokopedia/rechargeapp/localize"\n\t"github.com/tokopedia/rechargeapp/src/agent"\n\tagentRC "github.com/tokopedia/rechargeapp/src/agent/rc"\n\t"github.com/tokopedia/rechargeapp/src/common"\n\t"github.com/tokopedia/rechargeapp/src/frontend/global"\n\t"github.com/tokopedia/rechargeapp/src/lib"\n\tstatenew "github.com/tokopedia/rechargeapp/state"\n\t"github.com/tokopedia/rechargeapp/util/convert"\n\t"github.com/tokopedia/rechargeapp/util/format"\n\t"github.com/tokopedia/rechargeapp/util/validator"\n)\n\nfunc (m *ModuleImpl) RefreshKey() (string, error) {\n\t// generate stan\n\tstan, err := m.generateSTAN(0)\n\tif err != nil {\n\t\tm.logger.EPrint("[Key] Error generating stan", err)\n\n\t\treturn "", err\n\t}\n\n\t// create key request\n\tkeyReq := keyRequest{\n\t\tCID: m.configVault.CID,\n\t\tSTAN: stan,\n\t}\n\tkeyResp, err := m.service.refreshKey(m, keyReq)\n\tif err != nil {\n\t\tm.logger.EPrint("[Key] Error refresh key", err)\n\n\t\treturn "", err\n\t}\n\n\t// refresh key failed\n\tif keyResp.response.RC() != responseSuccess {\n\t\terr = errors.New("Invalid response code " + keyResp.response.RC())\n\t\tm.logger.EPrint("[Key] Failed refresh key", err)\n\n\t\treturn "", err\n\t}\n\n\t// decrypt session key from response\n\tdecryptedSessionKey, err := DecryptECBTripleDES(m.configVault.PrivateKey, keyResp.response.Bit48)\n\tif err != nil {\n\t\tm.logger.EPrint("[Key] Error decrypting session key", err)\n\n\t\treturn "", err\n\t}\n\n\t// save to redis\n\terr = m.redisClient.Setex(redisDecryptedKey, constant.RedisOneDay, decryptedSessionKey)\n\tif err != nil {\n\t\tm.logger.EPrint("[Key] Error saving key to redis", err)\n\n\t\treturn "", err\n\t}\n\n\treturn decryptedSessionKey, nil\n}\n\nfunc (m *ModuleImpl) InquiryPLNPrepaid(r agent.EnquiryRequest) (agent.EnquiryResponse, error) {\n\tvar (\n\t\terr error\n\t\tstan string\n\t)\n\n\trespData := &global.PlnData{\n\t\tAgentID: m.agentID,\n\t}\n\tresult := agent.EnquiryResponse{\n\t\tGeneralRC: statenew.GRC_GENERAL_FAULT,\n\t\tRespData: respData,\n\t}\n\n\tdefer func() {\n\t\tlib.GetEnquiry().InsertLog(lib.EnquiryLog{\n\t\t\tProductID: r.ProductID,\n\t\t\tClientNumber: r.ClientNumber,\n\t\t\tUserID: r.UserStr.UserID,\n\t\t\tAgentID: m.agentID,\n\t\t\tResponseCode: result.AgentRC,\n\t\t\tGenericResponseCode: result.GeneralRC,\n\t\t\tRequest: result.Raw.Request,\n\t\t\tResponse: result.Raw.Response,\n\t\t\tErrorMessage: fmt.Sprintf("ErrorMessage:[%s], err:[%v]", result.ErrorMessage, err),\n\t\t\tLatency: result.Latency,\n\t\t\tOperatorID: r.OperatorStr.ID,\n\t\t\tSource: r.Source,\n\t\t\tLinkID: r.OrderAgentReqID,\n\t\t})\n\t}()\n\n\tstan, err = m.generateSTAN(r.OrderAgentReqID)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Inquiry] Generate stan failed, client number: %s ; error: %s ", r.ClientNumber, err.Error()))\n\t\treturn result, err\n\t}\n\n\ttoken, err := m.generateToken(stan)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Inquiry] Get key failed, client number: %s ; error: %s ", r.ClientNumber, err.Error()))\n\t\treturn result, err\n\t}\n\n\tinqReq := inquiryRequest{\n\t\tCID: m.configVault.CID,\n\t\tSTAN: stan,\n\t\ttoken: token,\n\t\tclientNumber: r.ClientNumber,\n\t\tcategory: PLNPrepaid,\n\t}\n\n\tstartTime := clock.Now()\n\tresp, err := m.service.createInquiry(m, inqReq)\n\telapsed := clock.Since(startTime).Seconds()\n\n\tresult.Raw.Request = convert.ToString(resp.request)\n\tresult.Raw.Response = convert.ToString(resp.response)\n\tresult.Latency = elapsed\n\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Inquiry] Request inquiry failed, client number: %s ; error: %s ", r.ClientNumber, err.Error()))\n\t\treturn result, err\n\t} else if rc := resp.response.RC(); rc != responseSuccess {\n\t\tresult.AgentRC = rc\n\t\tagErr := &agentRC.AgentError{\n\t\t\tAgentProductID: int64(r.AgentProductStr.ID),\n\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\tCode: rc,\n\t\t\tOperatorStr: r.OperatorStr,\n\t\t\tProductStr: r.ProductStr,\n\t\t\tAgentProductStr: r.AgentProductStr,\n\t\t\tClientNumber: r.ClientNumber,\n\t\t\tOrderAgentReqID: convert.ToInt(r.OrderAgentReqID),\n\t\t\tSource: r.Source,\n\t\t}\n\t\tagErr.CheckAgentErrorV2()\n\t\trespData.ErrorMessage = agErr.ErrorMessage\n\t\tresult.ErrorMessage = agErr.ErrorMessage\n\t\tif agErr.IsUserError {\n\t\t\terr = agent.ErrUserInquiry\n\t\t} else {\n\t\t\terr = fmt.Errorf(%s, agErr.Message)\n\t\t}\n\t\tresult.GeneralRC = agErr.GeneralRC\n\t\treturn result, err\n\t}\n\n\tresult.AgentRC = resp.response.RC()\n\tresult.GeneralRC = statenew.GRC_SUCCESS\n\n\tparsedData, err := PLNPrepaid.parseResponse(inqReq.getRequestType(), resp.response)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Inquiry] Parse response failed, client number: %s ; error: %s ", r.ClientNumber, err.Error()))\n\t\treturn result, err\n\t}\n\n\tresult.RespData = parsedData.(*global.PlnData)\n\tresult.RespMessage = resp.response\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) PaymentPLNPrepaid(rd agent.RechargeRequestData) (agent.RechargeRequestResult, error) {\n\tvar (\n\t\tresult = agent.RechargeRequestResult{\n\t\t\tStatusRecharge: constant.OrderLogWaitingRetry,\n\t\t\tSerialNumber: "N/A",\n\t\t\tCogs: 0,\n\t\t\tRevenue: 0,\n\t\t}\n\n\t\tclientNumber = rd.ClientNumber\n\t\torderAgentReqID = rd.OrderAgentReqID\n\t\torderID = rd.OrderID\n\t\tproductID = rd.ProductID\n\t\tagentID = rd.AgentID\n\n\t\tenquiryRequest = agent.EnquiryRequest{\n\t\t\tUserStr: rd.UserStr,\n\t\t\tClientNumber: clientNumber,\n\t\t\tProductID: productID,\n\t\t\tOrderAgentReqID: int64(orderAgentReqID),\n\t\t\tOperatorStr: rd.OperatorStr,\n\t\t\tProductStr: rd.ProductStr,\n\t\t\tAgentProductStr: rd.AgentProductStr,\n\t\t\tSource: agentRC.FromPayment,\n\t\t}\n\n\t\tlogMsg string\n\t\tdata *global.PlnData\n\t)\n\n\tinqResp, err := m.InquiryPLNPrepaid(enquiryRequest)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(orderID, productID, agentID, clientNumber, fmt.Sprintf("Re-inquiry error: %s", err))\n\t\treturn result, err\n\t}\n\n\tinqData, _ := inqResp.RespData.(*global.PlnData)\n\n\tresult.Cogs, result.Revenue = lib.CalculateOrderCogs(rd.OrderStr.SalesPrice, *rd.AgentProductStr, 1)\n\n\tresp, _ := inqResp.RespMessage.(Message)\n\n\ttoken, err := m.generateToken(resp.Bit11)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(rd.OrderID, rd.ProductID, rd.AgentID, rd.ClientNumber, fmt.Sprintf("generate token failed for number: %s, error: %s", rd.ClientNumber, err.Error()))\n\t\treturn result, err\n\t}\n\n\t// Update STAN record\n\terr = m.orderLib.SetOrderAgentRequestSTAN(orderAgentReqID, inqData.RefID)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(orderID, productID, agentID, clientNumber, fmt.Sprintf("failed to set order agent request STAN: %s", err.Error()))\n\t\treturn result, err\n\t}\n\n\tpayReq := paymentRequest{\n\t\tCID: m.configVault.CID,\n\t\tSTAN: resp.Bit11,\n\t\ttoken: token,\n\t\tclientNumber: clientNumber,\n\t\tproductCode: rd.AgentProductStr.ProductCode,\n\t\torderID: orderID,\n\t\tbit4: resp.Bit4,\n\t\tbit48: resp.Bit48,\n\t\tbit62: resp.Bit62,\n\t\tcategory: PLNPrepaid,\n\t}\n\n\tpayResp, err := m.service.createPayment(m, payReq)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Payment] Request orderAgentReqID: %d ; error: %s ", orderAgentReqID, err.Error()))\n\t\tresult.StatusRecharge, result.RC = m.processErrorPayment(err)\n\t\tlogMsg = err.Error()\n\t} else {\n\t\tif result.RC = payResp.response.RC(); result.RC == responseSuccess {\n\t\t\tparsedData, err := PLNPrepaid.parseResponse(payReq.getRequestType(), payResp.response)\n\t\t\tif err != nil {\n\t\t\t\tresult.StatusRecharge = constant.OrderLogPending\n\t\t\t\tlogMsg = "PENDING - failed to parse response"\n\t\t\t} else {\n\t\t\t\tresult.StatusRecharge = constant.OrderLogPending\n\t\t\t\tlogMsg = "PENDING - empty token"\n\n\t\t\t\tdata = parsedData.(*global.PlnData)\n\t\t\t\tif !validator.IsEmpty(strings.TrimSpace(data.Token)) {\n\t\t\t\t\tresult.StatusRecharge = constant.OrderLogSuccess\n\t\t\t\t\tresult.SerialNumber = fmt.Sprintf("%s %s kWh %.2f Token: %s",\n\t\t\t\t\t\tdata.ClientName,\n\t\t\t\t\t\tdata.MeterType,\n\t\t\t\t\t\tdata.Kwh,\n\t\t\t\t\t\tformat.AddSeparator(data.Token, "-", 4))\n\t\t\t\t\tlogMsg = logSuccess\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Non success responses\n\t\t\tagErr := &agentRC.AgentError{\n\t\t\t\tAgentProductID: int64(rd.AgentProductStr.ID),\n\t\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\t\tCode: result.RC,\n\t\t\t\tOperatorStr: rd.OperatorStr,\n\t\t\t\tProductStr: rd.ProductStr,\n\t\t\t\tAgentProductStr: rd.AgentProductStr,\n\t\t\t\tClientNumber: rd.ClientNumber,\n\t\t\t\tOrderAgentReqID: rd.OrderAgentReqID,\n\t\t\t\tSource: agentRC.FromPayment,\n\t\t\t}\n\t\t\tagErr.CheckAgentErrorV2()\n\n\t\t\tresult.StatusRecharge = agErr.Status\n\t\t\tlogMsg = agErr.Message\n\t\t\tif agErr.AutoOff {\n\t\t\t\tlib.DisableAgentProduct(rd.AgentProductStr.ID)\n\t\t\t}\n\t\t}\n\t}\n\n\tif result.StatusRecharge == constant.OrderLogSuccess {\n\t\t// Calculate admin fee from salesPrice and rechargeValue\n\t\t// because PLN prepaid does not have actual admin fee\n\t\tdata.Admin = rd.OrderStr.SalesPrice - rd.ProductStr.RechargeValue\n\t\tdata.Token = format.AddSeparator(data.Token, " ", 4)\n\t\tdata.InfoText = payResp.response.Bit63\n\n\t\tagentData := &global.AgentData{\n\t\t\tOrderID: rd.OrderID,\n\t\t\tAgentID: m.agentID,\n\t\t\tCategoryID: rd.CategoryID,\n\t\t\tOperatorID: rd.OperatorStr.ID,\n\t\t\tAmount: rd.OrderStr.SalesPrice,\n\t\t\tReffNumber: data.RefID,\n\t\t\tDetails: convert.ToString(data),\n\t\t\tCreatedTime: rd.OrderAgentReqStr.CreateTime,\n\t\t}\n\n\t\tif err = m.orderLib.InsertAgentData(agentData); err != nil {\n\t\t\tm.logger.EPrint(fmt.Sprintf("[Payment] Insert PLN data failed for id %d: %s ", rd.OrderAgentReqID, err))\n\t\t\tlogMsg = logMsg + " - Failed to insert PLN Data"\n\t\t}\n\t}\n\n\trechargeLog := &common.RLogStruct{\n\t\tStatus: result.StatusRecharge,\n\t\tOrderID: orderID,\n\t\tClientNumber: clientNumber,\n\t\tTransactionID: convert.ToString(orderAgentReqID),\n\t\tVoucherCode: result.SerialNumber,\n\t\tProductID: productID,\n\t\tAgentID: agentID,\n\t\tRequest: convert.ToString(payResp.request),\n\t\tResponse: convert.ToString(payResp.response),\n\t\tMessage: "[PAYMENT] " + logMsg,\n\t}\n\n\tif err = common.LogFunc.InsertRechargeLog(rechargeLog, nil); err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Payment] Error while inserting recharge log orderAgentReqID: %d ; error: %s ", orderAgentReqID, err.Error()))\n\t}\n\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) AdvicePLNPrepaid(cs agent.CheckStatusData) (agent.CheckStatusResult, error) {\n\tresult := agent.CheckStatusResult{\n\t\tStatusCheck: constant.OrderLogPending,\n\t\tSerialNumber: "N/A",\n\t\tCogs: float64(0),\n\t\tRevenue: float64(0),\n\t\tUpdateSerialNumber: true,\n\t}\n\n\tvar (\n\t\tcount int64\n\t\ttxID string\n\t\tlogMsg string\n\t\tprevReq Message\n\t\terr error\n\n\t\tclientNumber = cs.ClientNumber\n\t\torderAgentReqID = cs.OrderAgentReqID\n\t\tproductID = cs.ProductID\n\t\tagentID = cs.AgentID\n\t\tdata = &global.PlnData{}\n\t)\n\n\tcount, err = m.isEligible(AdviceRequest, cs.OrderAgentReqStr)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(cs.OrderID, cs.ProductID, cs.AgentID, cs.ClientNumber, fmt.Sprintf("not eligible for advice, err: %s", err.Error()))\n\t\treturn result, err\n\t}\n\n\tprevReqStr, err := m.orderLib.GetLatestRechargeLogRequest(cs.OrderID)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(cs.OrderID, cs.ProductID, cs.AgentID, cs.ClientNumber, "failed to get latest recharge log request")\n\t\treturn result, err\n\t}\n\n\terr = json.Unmarshal([]byte(prevReqStr), &prevReq)\n\tif err != nil {\n\t\tcommon.LogFunc.LogEarlyFailedTransaction(cs.OrderID, cs.ProductID, cs.AgentID, cs.ClientNumber, "failed to unmarshal latest recharge log request")\n\t\treturn result, err\n\t}\n\n\ttoken, err := m.generateToken(prevReq.Bit11)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Advice] generate token failed, client number: %s ; error: %s ", cs.ClientNumber, err.Error()))\n\t\treturn result, err\n\t}\n\n\tadvReq := adviceRequest{\n\t\tCID: m.configVault.CID,\n\t\tSTAN: prevReq.Bit11,\n\t\ttoken: token,\n\t\tclientNumber: clientNumber,\n\t\tproductCode: cs.AgentProductStr.ProductCode,\n\t\torderID: cs.OrderID,\n\t\tbit4: prevReq.Bit4,\n\t\tbit48: prevReq.Bit48,\n\t\tbit62: prevReq.Bit62,\n\t\tcount: count,\n\t\tcategory: PLNPrepaid,\n\t}\n\n\t// Do check status request.\n\tadviceResp, err := m.service.createAdvice(m, advReq)\n\tif err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Advice] request error orderAgentReqID: %d; error: %s ", orderAgentReqID, err.Error()))\n\t\tlogMsg = err.Error()\n\t\t// Default status on error, set all as pending, waiting for manual process.\n\t\tresult.StatusCheck = constant.OrderLogPending\n\t\tresult.RC = statenew.AGENT_RC_DEFAULT_ERROR\n\t} else if result.RC = adviceResp.response.RC(); result.RC == responseSuccess {\n\t\tparsedData, err := PLNPrepaid.parseResponse(advReq.getRequestType(), adviceResp.response)\n\t\tif err != nil {\n\t\t\tresult.StatusCheck = constant.OrderLogPending\n\t\t\tlogMsg = "PENDING - failed to parse response"\n\t\t} else {\n\t\t\tdata = parsedData.(*global.PlnData)\n\n\t\t\tresult.StatusCheck = constant.OrderLogPending\n\t\t\tlogMsg = "PENDING - dempty token"\n\n\t\t\tif !validator.IsEmpty(strings.TrimSpace(data.Token)) {\n\t\t\t\tresult.StatusCheck = constant.OrderLogSuccess\n\t\t\t\tresult.SerialNumber = fmt.Sprintf("%s %s kWh %.2f Token: %s",\n\t\t\t\t\tdata.ClientName,\n\t\t\t\t\tdata.MeterType,\n\t\t\t\t\tdata.Kwh,\n\t\t\t\t\tformat.AddSeparator(data.Token, "-", 4))\n\t\t\t\tlogMsg = logSuccess\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Non success responses\n\t\tagErr := &agentRC.AgentError{\n\t\t\tAgentProductID: int64(cs.AgentProductStr.ID),\n\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\tCode: result.RC,\n\t\t\tOperatorStr: cs.OperatorStr,\n\t\t\tProductStr: cs.ProductStr,\n\t\t\tAgentProductStr: cs.AgentProductStr,\n\t\t\tClientNumber: cs.ClientNumber,\n\t\t\tOrderAgentReqID: cs.OrderAgentReqID,\n\t\t\tSource: agentRC.FromPayment,\n\t\t}\n\t\tagErr.CheckAgentErrorV2()\n\n\t\tresult.StatusCheck = agErr.Status\n\t\tlogMsg = agErr.Message\n\t\tif agErr.AutoOff {\n\t\t\tlib.DisableAgentProduct(cs.AgentProductStr.ID)\n\t\t}\n\t}\n\n\tif result.StatusCheck == constant.OrderLogSuccess {\n\t\t// Calculate admin fee from salesPrice and rechargeValue\n\t\t// because PLN prepaid does not have actual admin fee\n\t\tdata.Admin = cs.OrderStr.SalesPrice - cs.ProductStr.RechargeValue\n\t\tdata.Token = format.AddSeparator(data.Token, " ", 4)\n\t\tdata.InfoText = adviceResp.response.Bit63\n\n\t\tagentData := &global.AgentData{\n\t\t\tOrderID: cs.OrderID,\n\t\t\tAgentID: m.agentID,\n\t\t\tCategoryID: cs.CategoryID,\n\t\t\tOperatorID: cs.OperatorStr.ID,\n\t\t\tAmount: cs.OrderStr.SalesPrice,\n\t\t\tReffNumber: data.RefID,\n\t\t\tDetails: convert.ToString(data),\n\t\t\tCreatedTime: cs.OrderAgentReqStr.CreateTime,\n\t\t}\n\n\t\tif err = m.orderLib.InsertAgentData(agentData); err != nil {\n\t\t\tm.logger.EPrint(fmt.Sprintf("[Advice] insert PLN data failed for id %d: %s ", cs.OrderAgentReqID, err))\n\t\t\tlogMsg = logMsg + "- Failed to insert PLN Data"\n\t\t}\n\t}\n\n\trechargeLog := &common.RLogStruct{\n\t\tStatus: result.StatusCheck,\n\t\tOrderID: cs.OrderID,\n\t\tClientNumber: clientNumber,\n\t\tTransactionID: txID,\n\t\tVoucherCode: result.SerialNumber,\n\t\tProductID: productID,\n\t\tAgentID: agentID,\n\t\tRequest: convert.ToString(adviceResp.request),\n\t\tResponse: convert.ToString(adviceResp.response),\n\t\tMessage: "[ADVICE] " + logMsg,\n\t}\n\n\tif err = common.LogFunc.InsertRechargeLog(rechargeLog, nil); err != nil {\n\t\tm.logger.EPrint(fmt.Sprintf("[Advice] error while inserting recharge log orderAgentReqID: %d ; error: %s ", orderAgentReqID, err.Error()))\n\t}\n\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) InquiryPLNNonTagihanListrik(r agent.EnquiryRequest) (agent.EnquiryResponse, error) {\n\tvar (\n\t\trespData = &global.PlnNonTagihanListrikData{\n\t\t\tAgentID: m.agentID,\n\t\t}\n\t\tclientNumber = r.ClientNumber\n\t\torderAgentReqID = r.OrderAgentReqID\n\t\tproductID = r.ProductID\n\t\terr error\n\n\t\t// agent inquiry request and response\n\t\tinqReq = inquiryRequest{\n\t\t\tCID: m.configVault.CID,\n\t\t\tclientNumber: clientNumber,\n\t\t\tcategory: PLNNonTagLis,\n\t\t}\n\t\tinqResp inquiryResponse\n\n\t\t// default enquiry response\n\t\tresult = agent.EnquiryResponse{\n\t\t\tGeneralRC: statenew.GRC_GENERAL_FAULT,\n\t\t\tRaw: agent.Raw{\n\t\t\t\tRequest: convert.ToString(inqResp.request),\n\t\t\t\tResponse: convert.ToString(inqResp.response),\n\t\t\t},\n\t\t\tRespData: respData,\n\t\t}\n\t)\n\n\t// insert to enquiry log\n\tdefer func() {\n\t\tvar errMsg string\n\t\tif err != nil {\n\t\t\terrMsg = err.Error()\n\t\t}\n\t\tlib.GetEnquiry().InsertLog(lib.EnquiryLog{\n\t\t\tProductID: productID,\n\t\t\tClientNumber: clientNumber,\n\t\t\tUserID: r.UserStr.UserID,\n\t\t\tAgentID: m.agentID,\n\t\t\tResponseCode: result.AgentRC,\n\t\t\tGenericResponseCode: result.GeneralRC,\n\t\t\tRequest: result.Raw.Request,\n\t\t\tResponse: result.Raw.Response,\n\t\t\tErrorMessage: "ErrorMessage:[" + result.ErrorMessage + "], err:[" + errMsg + "]",\n\t\t\tLatency: result.Latency,\n\t\t\tOperatorID: r.OperatorStr.ID,\n\t\t\tSource: r.Source,\n\t\t\tLinkID: orderAgentReqID,\n\t\t})\n\t}()\n\n\t// generate stan\n\tinqReq.STAN, err = m.generateSTAN(orderAgentReqID)\n\tif err != nil {\n\t\tm.logger.EPrint("[Inquiry] Error generating stan, client number: "+clientNumber, err)\n\n\t\treturn result, err\n\t}\n\n\t// generate token\n\tinqReq.token, err = m.generateToken(inqReq.STAN)\n\tif err != nil {\n\t\tm.logger.EPrint("[Inquiry] Error generating token, client number: "+clientNumber, err)\n\n\t\treturn result, err\n\t}\n\n\t// hit inquiry and count the latency\n\tstartTime := clock.Now()\n\tinqResp, err = m.service.createInquiry(m, inqReq)\n\telapsed := clock.Since(startTime).Seconds()\n\n\t// attach request, response, and latency to enquiry response\n\tresult.Raw.Request = convert.ToString(inqResp.request)\n\tresult.Raw.Response = convert.ToString(inqResp.response)\n\tresult.Latency = elapsed\n\n\t// inquiry error\n\tif err != nil {\n\t\tm.logger.EPrint("[Inquiry] Error inquiry, client number: "+clientNumber, err)\n\n\t\treturn result, err\n\t}\n\n\t// extract agent response code\n\trespCode := inqResp.response.RC()\n\tresult.AgentRC = respCode\n\trespData.AggregatorErrorCode = respCode\n\n\t// other response from agent\n\tif respCode != responseSuccess {\n\t\tagErr := &agentRC.AgentError{\n\t\t\tAgentProductID: convert.ToInt64(r.AgentProductStr.ID),\n\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\tCode: respCode,\n\t\t\tOperatorStr: r.OperatorStr,\n\t\t\tProductStr: r.ProductStr,\n\t\t\tAgentProductStr: r.AgentProductStr,\n\t\t\tOrderAgentReqID: convert.ToInt(orderAgentReqID),\n\t\t\tClientNumber: clientNumber,\n\t\t\tSource: r.Source,\n\t\t}\n\t\tagErr.CheckAgentErrorV2()\n\n\t\t// inquiry failed\n\t\tresult.GeneralRC = agErr.GeneralRC\n\t\tresult.ErrorMessage = agErr.ErrorMessage\n\n\t\t// fill global data\n\t\trespData.ErrorMessage = agErr.ErrorMessage\n\t\tresult.RespData = respData\n\n\t\t// check for user error flag\n\t\terr = errors.New(agErr.Message)\n\t\tif agErr.IsUserError {\n\t\t\terr = agent.ErrUserInquiry\n\t\t\tresult.IsUserError = true\n\t\t}\n\n\t\treturn result, err\n\t}\n\n\t// inquiry success\n\tresult.GeneralRC = statenew.GRC_SUCCESS\n\tresult.RespMessage = inqResp.response\n\n\t// fill global data\n\terr = PLNNonTagLis.parseResponse(respData, inqReq.getRequestType(), inqResp.response)\n\tif err != nil {\n\t\tm.logger.EPrint("[Inquiry] Error parsing response, client number: "+clientNumber, err)\n\n\t\treturn result, err\n\t}\n\tresult.RespData = respData\n\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) PaymentPLNNonTagihanListrik(rd agent.RechargeRequestData) (agent.RechargeRequestResult, error) {\n\tvar (\n\t\tresult = agent.RechargeRequestResult{\n\t\t\tStatusRecharge: constant.OrderLogWaitingRetry,\n\t\t\tSerialNumber: "N/A",\n\t\t\tCogs: 0,\n\t\t\tRevenue: 0,\n\t\t}\n\t\tclientNumber = rd.ClientNumber\n\t\torderID = rd.OrderID\n\t\torderAgentReqID = rd.OrderAgentReqID\n\t\tproductID = rd.ProductID\n\t\tagentID = rd.AgentID\n\t\tlogMsg string\n\t\terr error\n\n\t\tpayReq = paymentRequest{\n\t\t\tCID: m.configVault.CID,\n\t\t\tproductCode: rd.AgentProductStr.ProductCode,\n\t\t\tclientNumber: clientNumber,\n\t\t\torderID: orderID,\n\t\t\tcategory: PLNNonTagLis,\n\t\t}\n\t\tpayResp paymentResponse\n\t)\n\n\t// insert to recharge log\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tlogMsg += " " + err.Error()\n\t\t}\n\t\trechargeLog := &common.RLogStruct{\n\t\t\tStatus: result.StatusRecharge,\n\t\t\tOrderID: orderID,\n\t\t\tClientNumber: clientNumber,\n\t\t\tTransactionID: convert.ToString(orderAgentReqID),\n\t\t\tVoucherCode: result.SerialNumber,\n\t\t\tProductID: productID,\n\t\t\tAgentID: agentID,\n\t\t\tRequest: convert.ToString(payResp.request),\n\t\t\tResponse: convert.ToString(payResp.response),\n\t\t\tMessage: "[PAYMENT] " + logMsg,\n\t\t}\n\t\tif err = common.LogFunc.InsertRechargeLog(rechargeLog, nil); err != nil {\n\t\t\tm.logger.EPrint("[Payment] Error inserting recharge log, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\t\t}\n\t}()\n\n\t// re-inquiry before payment\n\tenqReq := agent.EnquiryRequest{\n\t\tUserStr: rd.UserStr,\n\t\tClientNumber: clientNumber,\n\t\tProductID: productID,\n\t\tOrderAgentReqID: int64(orderAgentReqID),\n\t\tOperatorStr: rd.OperatorStr,\n\t\tProductStr: rd.ProductStr,\n\t\tAgentProductStr: rd.AgentProductStr,\n\t\tSource: agentRC.FromPayment,\n\t}\n\tenqResp, err := m.InquiryPLNNonTagihanListrik(enqReq)\n\tif err != nil {\n\t\tresult.StatusRecharge = constant.OrderLogFailed\n\n\t\treturn result, err\n\t}\n\n\t// parse global data\n\tparsedGlobalData, _ := enqResp.RespData.(*global.PlnNonTagihanListrikData)\n\n\t// append payment request from inquiry global data\n\tpayReq.billAmount = parsedGlobalData.PLNBillValue\n\tpayReq.feeAmount = parsedGlobalData.AdministrationCharge\n\n\t// sales price validation\n\terr = m.validateSalesPrice(rd.OrderStr.SalesPrice, parsedGlobalData.TotalTransactionAmount+parsedGlobalData.AdministrationCharge)\n\tif err != nil {\n\t\tresult.StatusRecharge = constant.OrderLogFailed\n\n\t\treturn result, err\n\t}\n\n\t// calculate COGS and Revenue\n\tresult.Cogs, result.Revenue = lib.CalculateOrderCogs(rd.OrderStr.SalesPrice, *rd.AgentProductStr, 1)\n\n\t// parse inquiry response\n\tinqResp, _ := enqResp.RespMessage.(Message)\n\n\t// append payment request from inquiry response\n\tpayReq.STAN = inqResp.Bit11\n\tpayReq.bit4 = inqResp.Bit4\n\tpayReq.bit48 = inqResp.Bit48\n\tpayReq.bit62 = inqResp.Bit62\n\n\t// generate token\n\tpayReq.token, err = m.generateToken(payReq.STAN)\n\tif err != nil {\n\t\tresult.StatusRecharge = constant.OrderLogWaitingRetry\n\t\tm.logger.EPrint("[Payment] Error generating Token, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// update stan record\n\terr = m.orderLib.SetOrderAgentRequestSTAN(orderAgentReqID, parsedGlobalData.AggregatorReferenceNumber)\n\tif err != nil {\n\t\tresult.StatusRecharge = constant.OrderLogFailed\n\t\tm.logger.EPrint("[Payment] Error updating order agent request, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// hit payment\n\tpayResp, err = m.service.createPayment(m, payReq)\n\tif err != nil {\n\t\tresult.StatusRecharge, result.RC = m.processErrorPayment(err)\n\t\tm.logger.EPrint("[Payment] Error payment, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// extract agent response code\n\trespCode := payResp.response.RC()\n\tresult.RC = respCode\n\n\t// other response from agent\n\tif respCode != responseSuccess {\n\t\tagErr := &agentRC.AgentError{\n\t\t\tAgentProductID: convert.ToInt64(rd.AgentProductStr.ID),\n\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\tCode: respCode,\n\t\t\tOperatorStr: rd.OperatorStr,\n\t\t\tProductStr: rd.ProductStr,\n\t\t\tAgentProductStr: rd.AgentProductStr,\n\t\t\tClientNumber: clientNumber,\n\t\t\tOrderAgentReqID: orderAgentReqID,\n\t\t\tSource: agentRC.FromPayment,\n\t\t}\n\t\tagErr.CheckAgentErrorV2()\n\n\t\tif agErr.AutoOff {\n\t\t\t_ = lib.DisableAgentProduct(rd.AgentProductStr.ID)\n\t\t}\n\n\t\tresult.StatusRecharge = agErr.Status\n\t\tlogMsg = agErr.Message\n\n\t\treturn result, nil\n\t}\n\n\t// parse response\n\terr = PLNNonTagLis.parseResponse(parsedGlobalData, payReq.getRequestType(), payResp.response)\n\tif err != nil {\n\t\tresult.StatusRecharge = constant.OrderLogPending\n\t\tlogMsg = "PENDING - error parsing response."\n\t\tm.logger.EPrint("[Payment] Error parsing response, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// payment success\n\tresult.StatusRecharge = constant.OrderLogSuccess\n\tresult.SerialNumber = parsedGlobalData.AggregatorReferenceNumber\n\tlogMsg = logSuccess\n\n\tif result.StatusRecharge == constant.OrderLogSuccess {\n\t\tparsedGlobalData.OrderID = rd.OrderStr.OrderID\n\t\tparsedGlobalData.InfoText = payResp.response.Bit63\n\n\t\t// insert detail agent data\n\t\tagentData := &global.AgentData{\n\t\t\tOrderID: orderID,\n\t\t\tAgentID: m.agentID,\n\t\t\tCategoryID: rd.CategoryID,\n\t\t\tOperatorID: rd.OperatorStr.ID,\n\t\t\tAmount: rd.OrderAgentReqStr.SalesPrice,\n\t\t\tReffNumber: result.SerialNumber,\n\t\t\tDetails: convert.ToString(parsedGlobalData),\n\t\t\tCreatedTime: rd.OrderAgentReqStr.CreateTime,\n\t\t}\n\t\tif err = m.orderLib.InsertAgentData(agentData); err != nil {\n\t\t\tm.logger.EPrint("[Payment] Error inserting detail agent data, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\t\t\tlogMsg += " - error inserting detail agent data."\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) ReversalPLNNonTagihanListrik(cs agent.CheckStatusData) (agent.CheckStatusResult, error) {\n\tvar (\n\t\tresult = agent.CheckStatusResult{\n\t\t\tStatusCheck: constant.OrderLogPending,\n\t\t\tSerialNumber: "N/A",\n\t\t\tCogs: 0,\n\t\t\tRevenue: 0,\n\t\t\tUpdateSerialNumber: true,\n\t\t}\n\t\tclientNumber = cs.ClientNumber\n\t\torderID = cs.OrderID\n\t\torderAgentReqID = cs.OrderAgentReqID\n\t\tproductID = cs.ProductID\n\t\tagentID = cs.AgentID\n\t\tlogMsg string\n\t\terr error\n\n\t\trevReq = reversalRequest{\n\t\t\tCID: m.configVault.CID,\n\t\t\tproductCode: cs.AgentProductStr.ProductCode,\n\t\t\tclientNumber: clientNumber,\n\t\t\torderID: orderID,\n\t\t\tcategory: PLNNonTagLis,\n\t\t}\n\t\trevResp reversalResponse\n\t)\n\n\t// insert to recharge log\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tlogMsg += " " + err.Error()\n\t\t}\n\t\trechargeLog := &common.RLogStruct{\n\t\t\tStatus: result.StatusCheck,\n\t\t\tOrderID: orderID,\n\t\t\tClientNumber: clientNumber,\n\t\t\tTransactionID: convert.ToString(orderAgentReqID),\n\t\t\tVoucherCode: result.SerialNumber,\n\t\t\tProductID: productID,\n\t\t\tAgentID: agentID,\n\t\t\tRequest: convert.ToString(revResp.request),\n\t\t\tResponse: convert.ToString(revResp.response),\n\t\t\tMessage: "[REVERSAL] " + logMsg,\n\t\t}\n\t\tif err = common.LogFunc.InsertRechargeLog(rechargeLog, nil); err != nil {\n\t\t\tm.logger.EPrint("[Reversal] Error inserting recharge log, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\t\t}\n\t}()\n\n\t// reversal validation and get counter from redis\n\trevReq.count, err = m.isEligible(ReversalRequest, cs.OrderAgentReqStr)\n\tif err != nil {\n\t\tlogMsg = "Ineligible for reversal."\n\t\tm.logger.EPrint("[Reversal] Ineligible for reversal, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// get payment request and response from recharge log\n\tpayRechargeLog, err := m.orderLib.GetLatestRechargeLog(orderID)\n\tif err != nil {\n\t\tlogMsg = "Error getting payment recharge log."\n\t\tm.logger.EPrint("[Reversal] Error getting payment recharge log, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// unmarshal payment request json\n\tvar payReq Message\n\terr = json.Unmarshal([]byte(payRechargeLog.Request), &payReq)\n\tif err != nil {\n\t\tlogMsg = "Error unmarshal payment request from recharge log."\n\t\tm.logger.EPrint("[Reversal] Error unmarshal payment request, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// append reversal request from payment request\n\trevReq.STAN = payReq.Bit11\n\trevReq.mti = payReq.MTI\n\trevReq.bit4 = payReq.Bit4\n\trevReq.bit11 = payReq.Bit11\n\trevReq.bit12 = payReq.Bit12\n\trevReq.bit32 = payReq.Bit32\n\trevReq.bit48 = payReq.Bit48\n\trevReq.bit62 = payReq.Bit62\n\n\t// unmarshal payment response json\n\tvar payResp Message\n\terr = json.Unmarshal([]byte(payRechargeLog.Response), &payResp)\n\tif err != nil {\n\t\tlogMsg = "Error unmarshal payment response from recharge log."\n\t\tm.logger.EPrint("[Reversal] Error unmarshal payment response, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// append reversal request from payment response\n\trevReq.bit61 = payResp.Bit61\n\n\t// generate token\n\trevReq.token, err = m.generateToken(revReq.STAN)\n\tif err != nil {\n\t\tm.logger.EPrint("[Reversal] Error generating Token, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// hit reversal\n\trevResp, err = m.service.createReversal(m, revReq)\n\tif err != nil {\n\t\tresult.RC = statenew.AGENT_RC_DEFAULT_ERROR\n\t\tm.logger.EPrint("[Reversal] Error reversal, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\n\t\treturn result, err\n\t}\n\n\t// extract agent response code\n\trespCode := revResp.response.RC()\n\tresult.RC = respCode\n\n\t// reversal success, set transaction to failed\n\tif respCode == responseSuccess {\n\t\tresult.StatusCheck = constant.OrderLogFailed\n\t\tlogMsg = "REFUND - reversal process success."\n\n\t\treturn result, nil\n\t}\n\n\t// other response from agent\n\tif respCode != responseSuccessByReversal {\n\t\tagErr := &agentRC.AgentError{\n\t\t\tAgentProductID: convert.ToInt64(cs.AgentProductStr.ID),\n\t\t\tAgentID: constant.AgentTypeBukopin,\n\t\t\tCode: respCode,\n\t\t\tOperatorStr: cs.OperatorStr,\n\t\t\tProductStr: cs.ProductStr,\n\t\t\tAgentProductStr: cs.AgentProductStr,\n\t\t\tClientNumber: clientNumber,\n\t\t\tOrderAgentReqID: orderAgentReqID,\n\t\t\tSource: agentRC.FromCheckStatus,\n\t\t}\n\t\tagErr.CheckAgentErrorV2()\n\n\t\tif agErr.AutoOff {\n\t\t\t_ = lib.DisableAgentProduct(cs.AgentProductStr.ID)\n\t\t}\n\n\t\t// reversal failed, set transaction to failed\n\t\tresult.StatusCheck = constant.OrderLogFailed\n\t\tlogMsg = "REFUND - reversal process failed. "\n\t\tlogMsg += agErr.Message\n\n\t\treturn result, nil\n\t}\n\n\t// parse response\n\tglobalData := &global.PlnNonTagihanListrikData{}\n\terr = PLNNonTagLis.parseResponse(globalData, revReq.getRequestType(), revResp.response)\n\tif err != nil {\n\t\t// use data from payment request\n\t\t_ = PLNNonTagLis.parseResponse(globalData, PaymentRequest, payReq)\n\t}\n\n\t// reversal failed, set transaction to success\n\tresult.StatusCheck = constant.OrderLogSuccess\n\tresult.SerialNumber = globalData.AggregatorReferenceNumber\n\tlogMsg = logSuccess\n\n\tif result.StatusCheck == constant.OrderLogSuccess {\n\t\tglobalData.AgentID = agentID\n\t\tglobalData.OrderID = cs.OrderStr.OrderID\n\t\tglobalData.InfoText = payResp.Bit63\n\n\t\t// insert detail agent data\n\t\tagentData := &global.AgentData{\n\t\t\tOrderID: orderID,\n\t\t\tAgentID: m.agentID,\n\t\t\tCategoryID: cs.CategoryID,\n\t\t\tOperatorID: cs.OperatorStr.ID,\n\t\t\tAmount: cs.OrderAgentReqStr.SalesPrice,\n\t\t\tReffNumber: result.SerialNumber,\n\t\t\tDetails: convert.ToString(globalData),\n\t\t\tCreatedTime: cs.OrderAgentReqStr.CreateTime,\n\t\t}\n\t\tif err = m.orderLib.InsertAgentData(agentData); err != nil {\n\t\t\tm.logger.EPrint("[Reversal] Error inserting detail agent data, orderAgentReqID: "+convert.ToString(orderAgentReqID), err)\n\t\t\tlogMsg += " - error inserting detail agent data."\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\nfunc (m *ModuleImpl) generateSTAN(orderAgentReqID int64) (string, error) {\n\t// use order agent request if possible\n\tif orderAgentReqID > 0 {\n\t\tstanRaw := convert.ToString(orderAgentReqID)\n\t\t// STAN (zero left-padding, n..12)\n\t\tstan := padRemainingSpace("0", 12, stanRaw) + stanRaw\n\n\t\treturn stan, nil\n\t}\n\n\t// generate stan manually\n\tstan, err := m.stanGenerator.GenerateWithPad()\n\tif err != nil {\n\t\tm.logger.EPrint("Error generating stan with pad", err)\n\n\t\treturn "", err\n\t}\n\n\treturn stan, nil\n}\n\nfunc (m *ModuleImpl) generateToken(stan string) (string, error) {\n\tbyteKey, err := m.redisClient.Get(redisDecryptedKey)\n\tif err != nil {\n\t\tm.logger.WPrint("Error getting key from redis", err)\n\t}\n\n\tkey := string(byteKey)\n\tif validator.IsEmpty(key) {\n\t\tkey, err = m.RefreshKey()\n\t\tif err != nil {\n\t\t\tm.logger.EPrint("Error refreshing key", err)\n\n\t\t\treturn "", err\n\t\t}\n\t}\n\n\ttraceNumber := stan + traceNumberPadding\n\ttoken, err := EncryptECBTripleDES(key, traceNumber)\n\tif err != nil {\n\t\tm.logger.EPrint("Error encrypting trace number", err)\n\n\t\treturn token, err\n\t}\n\n\treturn token, nil\n}\n\nfunc (m *ModuleImpl) validateSalesPrice(salesPrice, reInquiryPrice float64) error {\n\tif salesPrice != reInquiryPrice {\n\t\treturn constant.ErrorSalesPriceMismatch\n\t}\n\treturn nil\n}\n\nfunc (m *ModuleImpl) processErrorPayment(err error) (statusRecharge int, responseCode string) {\n\tif err == nil {\n\t\tstatusRecharge = constant.OrderLogWaitingRetry\n\n\t\treturn\n\t}\n\n\tif err == breaker.ErrBreakerOpen {\n\t\tstatusRecharge = constant.OrderLogWaitingRetry\n\t\tresponseCode = statenew.AGENT_RC_BREAKER_OPEN\n\n\t\treturn\n\t}\n\n\tstatusRecharge = constant.OrderLogPending\n\tresponseCode = statenew.AGENT_RC_DEFAULT_ERROR\n\n\treturn\n}\n\nfunc (m *ModuleImpl) isEligible(reqType requestType, orderAgentReqStr *entity.Order) (int64, error) {\n\tvar (\n\t\tnow = localize.ToJakartaTime(clock.Now())\n\t\treqTime = orderAgentReqStr.CreateTime\n\t\tbaseRedisKey, ok = redisCountMap[reqType]\n\t)\n\n\t// request type validation\n\tif !ok {\n\t\treturn 0, nil\n\t}\n\n\t// cut-off time validation\n\tcufOff := time.Date(reqTime.Year(), reqTime.Month(), reqTime.Day(), 23, 30, 0, 0, reqTime.Location())\n\tif now.After(cufOff) {\n\t\treturn 0, errors.New(string(reqType) + " request is only allowed on the same date before 23:30")\n\t}\n\n\t// increment the counter\n\tredisKey := baseRedisKey + ":" + convert.ToString(orderAgentReqStr.OrderAgentReqID)\n\tcount, err := m.redisClient.Incr(redisKey)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// maximum attempt validation\n\tif count > maximumAttempt {\n\t\treturn count, errors.New("Reached maximum " + string(reqType) + " request of 3 attempts, please do manual " + string(reqType))\n\t}\n\n\treturn count, nil\n}\n"}}

[Trace - 23:50:26.474 PM] Sending request 'textDocument/documentLink - (8)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:26.475 PM] Sending request 'textDocument/codeAction - (9)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 23:50:26.476 PM] Sending request 'textDocument/documentSymbol - (10)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:26.577 PM] Received response 'textDocument/documentLink - (8)' in 102ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":15}},"target":"https://pkg.go.dev/encoding/json"},{"range":{"start":{"line":4,"character":2},"end":{"line":4,"character":8}},"target":"https://pkg.go.dev/errors"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":5}},"target":"https://pkg.go.dev/fmt"},{"range":{"start":{"line":6,"character":2},"end":{"line":6,"character":9}},"target":"https://pkg.go.dev/strings"},{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":6}},"target":"https://pkg.go.dev/time"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":42}},"target":"https://pkg.go.dev/github.com/eapache/go-resiliency@v1.1.0/breaker"},{"range":{"start":{"line":10,"character":2},"end":{"line":10,"character":52}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/internal/constant"},{"range":{"start":{"line":11,"character":2},"end":{"line":11,"character":50}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/internal/entity"},{"range":{"start":{"line":12,"character":2},"end":{"line":12,"character":43}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/localize"},{"range":{"start":{"line":13,"character":2},"end":{"line":13,"character":44}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/agent"},{"range":{"start":{"line":14,"character":10},"end":{"line":14,"character":55}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/agent/rc"},{"range":{"start":{"line":15,"character":2},"end":{"line":15,"character":45}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/common"},{"range":{"start":{"line":16,"character":2},"end":{"line":16,"character":54}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/frontend/global"},{"range":{"start":{"line":17,"character":2},"end":{"line":17,"character":42}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/lib"},{"range":{"start":{"line":18,"character":11},"end":{"line":18,"character":49}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/state"},{"range":{"start":{"line":19,"character":2},"end":{"line":19,"character":47}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/convert"},{"range":{"start":{"line":20,"character":2},"end":{"line":20,"character":46}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/format"},{"range":{"start":{"line":21,"character":2},"end":{"line":21,"character":49}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/validator"}]

[Trace - 23:50:26.592 PM] Received response 'textDocument/codeAction - (9)' in 117ms.
Result: null

[Trace - 23:50:26.595 PM] Received response 'textDocument/documentSymbol - (10)' in 118ms.
Result: [{"name":"(*ModuleImpl).RefreshKey","detail":"()","kind":6,"range":{"start":{"line":24,"character":0},"end":{"line":70,"character":1}},"selectionRange":{"start":{"line":24,"character":21},"end":{"line":24,"character":31}}},{"name":"(*ModuleImpl).InquiryPLNPrepaid","detail":"(r agent.EnquiryRequest)","kind":6,"range":{"start":{"line":72,"character":0},"end":{"line":172,"character":1}},"selectionRange":{"start":{"line":72,"character":21},"end":{"line":72,"character":38}}},{"name":"(*ModuleImpl).PaymentPLNPrepaid","detail":"(rd agent.RechargeRequestData)","kind":6,"range":{"start":{"line":174,"character":0},"end":{"line":333,"character":1}},"selectionRange":{"start":{"line":174,"character":21},"end":{"line":174,"character":38}}},{"name":"(*ModuleImpl).AdvicePLNPrepaid","detail":"(cs agent.CheckStatusData)","kind":6,"range":{"start":{"line":335,"character":0},"end":{"line":489,"character":1}},"selectionRange":{"start":{"line":335,"character":21},"end":{"line":335,"character":37}}},{"name":"(*ModuleImpl).InquiryPLNNonTagihanListrik","detail":"(r agent.EnquiryRequest)","kind":6,"range":{"start":{"line":491,"character":0},"end":{"line":628,"character":1}},"selectionRange":{"start":{"line":491,"character":21},"end":{"line":491,"character":48}}},{"name":"(*ModuleImpl).PaymentPLNNonTagihanListrik","detail":"(rd agent.RechargeRequestData)","kind":6,"range":{"start":{"line":630,"character":0},"end":{"line":816,"character":1}},"selectionRange":{"start":{"line":630,"character":21},"end":{"line":630,"character":48}}},{"name":"(*ModuleImpl).ReversalPLNNonTagihanListrik","detail":"(cs agent.CheckStatusData)","kind":6,"range":{"start":{"line":818,"character":0},"end":{"line":1010,"character":1}},"selectionRange":{"start":{"line":818,"character":21},"end":{"line":818,"character":49}}},{"name":"(*ModuleImpl).generateSTAN","detail":"(orderAgentReqID int64)","kind":6,"range":{"start":{"line":1012,"character":0},"end":{"line":1031,"character":1}},"selectionRange":{"start":{"line":1012,"character":21},"end":{"line":1012,"character":33}}},{"name":"(*ModuleImpl).generateToken","detail":"(stan string)","kind":6,"range":{"start":{"line":1033,"character":0},"end":{"line":1058,"character":1}},"selectionRange":{"start":{"line":1033,"character":21},"end":{"line":1033,"character":34}}},{"name":"(*ModuleImpl).validateSalesPrice","detail":"(salesPrice float64, reInquiryPrice float64)","kind":6,"range":{"start":{"line":1060,"character":0},"end":{"line":1065,"character":1}},"selectionRange":{"start":{"line":1060,"character":21},"end":{"line":1060,"character":39}}},{"name":"(*ModuleImpl).processErrorPayment","detail":"(err error)","kind":6,"range":{"start":{"line":1067,"character":0},"end":{"line":1085,"character":1}},"selectionRange":{"start":{"line":1067,"character":21},"end":{"line":1067,"character":40}}},{"name":"(*ModuleImpl).isEligible","detail":"(reqType requestType, orderAgentReqStr *entity.Order)","kind":6,"range":{"start":{"line":1087,"character":0},"end":{"line":1118,"character":1}},"selectionRange":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}}]

[Trace - 23:50:26.670 PM] Sending request 'textDocument/foldingRange - (11)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:26.681 PM] Received response 'textDocument/foldingRange - (11)' in 11ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":21,"endCharacter":50,"kind":"imports"},{"startLine":24,"startCharacter":51,"endLine":69,"endCharacter":32},{"startLine":27,"startCharacter":16,"endLine":30,"endCharacter":16},{"startLine":34,"startCharacter":22,"endLine":36,"endCharacter":12},{"startLine":39,"startCharacter":16,"endLine":42,"endCharacter":16},{"startLine":46,"startCharacter":46,"endLine":50,"endCharacter":16},{"startLine":55,"startCharacter":16,"endLine":58,"endCharacter":16},{"startLine":63,"startCharacter":16,"endLine":66,"endCharacter":16},{"startLine":72,"startCharacter":95,"endLine":171,"endCharacter":19},{"startLine":73,"startCharacter":6,"endLine":75,"endCharacter":13},{"startLine":78,"startCharacter":29,"endLine":79,"endCharacter":20},{"startLine":81,"startCharacter":33,"endLine":83,"endCharacter":21},{"startLine":86,"startCharacter":15,"endLine":101,"endCharacter":4},{"startLine":87,"startCharacter":44,"endLine":100,"endCharacter":41},{"startLine":105,"startCharacter":16,"endLine":107,"endCharacter":20},{"startLine":111,"startCharacter":16,"endLine":113,"endCharacter":20},{"startLine":116,"startCharacter":26,"endLine":121,"endCharacter":26},{"startLine":132,"startCharacter":16,"endLine":134,"endCharacter":20},{"startLine":135,"startCharacter":60,"endLine":157,"endCharacter":20},{"startLine":137,"startCharacter":31,"endLine":146,"endCharacter":28},{"startLine":151,"startCharacter":24,"endLine":152,"endCharacter":29},{"startLine":153,"startCharacter":10,"endLine":154,"endCharacter":40},{"startLine":164,"startCharacter":16,"endLine":166,"endCharacter":20},{"startLine":174,"startCharacter":107,"endLine":332,"endCharacter":19},{"startLine":175,"startCharacter":6,"endLine":201,"endCharacter":24},{"startLine":176,"startCharacter":39,"endLine":180,"endCharacter":20},{"startLine":189,"startCharacter":40,"endLine":197,"endCharacter":39},{"startLine":205,"startCharacter":16,"endLine":207,"endCharacter":20},{"startLine":217,"startCharacter":16,"endLine":219,"endCharacter":20},{"startLine":224,"startCharacter":16,"endLine":226,"endCharacter":20},{"startLine":229,"startCharacter":26,"endLine":239,"endCharacter":26},{"startLine":243,"startCharacter":16,"endLine":246,"endCharacter":22},{"startLine":247,"startCharacter":9,"endLine":288,"endCharacter":3},{"startLine":248,"startCharacter":70,"endLine":267,"endCharacter":4},{"startLine":250,"startCharacter":18,"endLine":252,"endCharacter":49},{"startLine":253,"startCharacter":11,"endLine":266,"endCharacter":5},{"startLine":258,"startCharacter":58,"endLine":265,"endCharacter":24},{"startLine":268,"startCharacter":10,"endLine":287,"endCharacter":4},{"startLine":270,"startCharacter":32,"endLine":279,"endCharacter":40},{"startLine":285,"startCharacter":21,"endLine":286,"endCharacter":50},{"startLine":291,"startCharacter":55,"endLine":312,"endCharacter":3},{"startLine":292,"startCharacter":58,"endLine":293,"endCharacter":55,"kind":"comment"},{"startLine":298,"startCharacter":33,"endLine":306,"endCharacter":46},{"startLine":309,"startCharacter":62,"endLine":311,"endCharacter":51},{"startLine":315,"startCharacter":35,"endLine":325,"endCharacter":38},{"startLine":328,"startCharacter":74,"endLine":329,"endCharacter":141},{"startLine":335,"startCharacter":98,"endLine":488,"endCharacter":19},{"startLine":336,"startCharacter":35,"endLine":341,"endCharacter":26},{"startLine":344,"startCharacter":6,"endLine":355,"endCharacter":37},{"startLine":359,"startCharacter":16,"endLine":361,"endCharacter":20},{"startLine":365,"startCharacter":16,"endLine":367,"endCharacter":20},{"startLine":371,"startCharacter":16,"endLine":373,"endCharacter":20},{"startLine":377,"startCharacter":16,"endLine":379,"endCharacter":20},{"startLine":382,"startCharacter":25,"endLine":393,"endCharacter":26},{"startLine":398,"startCharacter":16,"endLine":403,"endCharacter":45},{"startLine":404,"startCharacter":79,"endLine":424,"endCharacter":3},{"startLine":406,"startCharacter":17,"endLine":408,"endCharacter":48},{"startLine":409,"startCharacter":10,"endLine":423,"endCharacter":4},{"startLine":415,"startCharacter":57,"endLine":422,"endCharacter":23},{"startLine":425,"startCharacter":9,"endLine":444,"endCharacter":3},{"startLine":427,"startCharacter":31,"endLine":436,"endCharacter":39},{"startLine":442,"startCharacter":20,"endLine":443,"endCharacter":49},{"startLine":447,"startCharacter":52,"endLine":468,"endCharacter":3},{"startLine":448,"startCharacter":58,"endLine":449,"endCharacter":55,"kind":"comment"},{"startLine":454,"startCharacter":33,"endLine":462,"endCharacter":46},{"startLine":465,"startCharacter":62,"endLine":467,"endCharacter":50},{"startLine":471,"startCharacter":35,"endLine":481,"endCharacter":37},{"startLine":484,"startCharacter":74,"endLine":485,"endCharacter":140},{"startLine":491,"startCharacter":105,"endLine":627,"endCharacter":19},{"startLine":492,"startCharacter":6,"endLine":517,"endCharacter":3},{"startLine":493,"startCharacter":46,"endLine":494,"endCharacter":21},{"startLine":502,"startCharacter":26,"endLine":505,"endCharacter":29},{"startLine":510,"startCharacter":33,"endLine":516,"endCharacter":21},{"startLine":512,"startCharacter":18,"endLine":514,"endCharacter":48},{"startLine":521,"startCharacter":15,"endLine":540,"endCharacter":4},{"startLine":523,"startCharacter":17,"endLine":524,"endCharacter":23},{"startLine":526,"startCharacter":44,"endLine":539,"endCharacter":39},{"startLine":545,"startCharacter":16,"endLine":548,"endCharacter":20},{"startLine":553,"startCharacter":16,"endLine":556,"endCharacter":20},{"startLine":570,"startCharacter":16,"endLine":573,"endCharacter":20},{"startLine":582,"startCharacter":33,"endLine":611,"endCharacter":20},{"startLine":583,"startCharacter":31,"endLine":592,"endCharacter":28},{"startLine":606,"startCharacter":24,"endLine":608,"endCharacter":28},{"startLine":620,"startCharacter":16,"endLine":623,"endCharacter":20},{"startLine":630,"startCharacter":117,"endLine":815,"endCharacter":19},{"startLine":631,"startCharacter":6,"endLine":653,"endCharacter":25},{"startLine":632,"startCharacter":39,"endLine":636,"endCharacter":20},{"startLine":646,"startCharacter":26,"endLine":651,"endCharacter":29},{"startLine":657,"startCharacter":15,"endLine":675,"endCharacter":3},{"startLine":658,"startCharacter":17,"endLine":659,"endCharacter":30},{"startLine":661,"startCharacter":36,"endLine":671,"endCharacter":39},{"startLine":673,"startCharacter":75,"endLine":674,"endCharacter":118},{"startLine":679,"startCharacter":32,"endLine":687,"endCharacter":38},{"startLine":690,"startCharacter":16,"endLine":693,"endCharacter":20},{"startLine":705,"startCharacter":16,"endLine":708,"endCharacter":20},{"startLine":725,"startCharacter":16,"endLine":729,"endCharacter":20},{"startLine":734,"startCharacter":16,"endLine":738,"endCharacter":20},{"startLine":743,"startCharacter":16,"endLine":747,"endCharacter":20},{"startLine":755,"startCharacter":33,"endLine":776,"endCharacter":20},{"startLine":756,"startCharacter":31,"endLine":765,"endCharacter":39},{"startLine":769,"startCharacter":20,"endLine":770,"endCharacter":53},{"startLine":781,"startCharacter":16,"endLine":786,"endCharacter":20},{"startLine":794,"startCharacter":55,"endLine":812,"endCharacter":3},{"startLine":799,"startCharacter":33,"endLine":807,"endCharacter":46},{"startLine":809,"startCharacter":62,"endLine":811,"endCharacter":52},{"startLine":818,"startCharacter":110,"endLine":1009,"endCharacter":19},{"startLine":819,"startCharacter":6,"endLine":842,"endCharacter":26},{"startLine":820,"startCharacter":35,"endLine":825,"endCharacter":27},{"startLine":835,"startCharacter":27,"endLine":840,"endCharacter":29},{"startLine":846,"startCharacter":15,"endLine":864,"endCharacter":3},{"startLine":847,"startCharacter":17,"endLine":848,"endCharacter":30},{"startLine":850,"startCharacter":36,"endLine":860,"endCharacter":40},{"startLine":862,"startCharacter":75,"endLine":863,"endCharacter":119},{"startLine":869,"startCharacter":16,"endLine":873,"endCharacter":20},{"startLine":878,"startCharacter":16,"endLine":882,"endCharacter":20},{"startLine":888,"startCharacter":16,"endLine":892,"endCharacter":20},{"startLine":908,"startCharacter":16,"endLine":912,"endCharacter":20},{"startLine":920,"startCharacter":16,"endLine":923,"endCharacter":20},{"startLine":928,"startCharacter":16,"endLine":932,"endCharacter":20},{"startLine":940,"startCharacter":33,"endLine":944,"endCharacter":20},{"startLine":948,"startCharacter":43,"endLine":971,"endCharacter":20},{"startLine":949,"startCharacter":31,"endLine":958,"endCharacter":43},{"startLine":962,"startCharacter":20,"endLine":963,"endCharacter":53},{"startLine":977,"startCharacter":16,"endLine":979,"endCharacter":68},{"startLine":987,"startCharacter":52,"endLine":1006,"endCharacter":3},{"startLine":993,"startCharacter":33,"endLine":1001,"endCharacter":46},{"startLine":1003,"startCharacter":62,"endLine":1005,"endCharacter":52},{"startLine":1012,"startCharacter":74,"endLine":1030,"endCharacter":17},{"startLine":1014,"startCharacter":25,"endLine":1019,"endCharacter":18},{"startLine":1024,"startCharacter":16,"endLine":1027,"endCharacter":16},{"startLine":1033,"startCharacter":65,"endLine":1057,"endCharacter":18},{"startLine":1035,"startCharacter":16,"endLine":1036,"endCharacter":54},{"startLine":1040,"startCharacter":28,"endLine":1046,"endCharacter":3},{"startLine":1042,"startCharacter":17,"endLine":1045,"endCharacter":17},{"startLine":1051,"startCharacter":16,"endLine":1054,"endCharacter":19},{"startLine":1060,"startCharacter":83,"endLine":1064,"endCharacter":11},{"startLine":1061,"startCharacter":34,"endLine":1062,"endCharacter":41},{"startLine":1067,"startCharacter":95,"endLine":1084,"endCharacter":7},{"startLine":1068,"startCharacter":16,"endLine":1071,"endCharacter":8},{"startLine":1074,"startCharacter":35,"endLine":1078,"endCharacter":8},{"startLine":1087,"startCharacter":101,"endLine":1117,"endCharacter":18},{"startLine":1088,"startCharacter":6,"endLine":1091,"endCharacter":43},{"startLine":1095,"startCharacter":9,"endLine":1096,"endCharacter":15},{"startLine":1101,"startCharacter":23,"endLine":1102,"endCharacter":98},{"startLine":1108,"startCharacter":16,"endLine":1109,"endCharacter":15},{"startLine":1113,"startCharacter":28,"endLine":1114,"endCharacter":128}]

[Trace - 23:50:26.682 PM] Sending request 'textDocument/codeLens - (12)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:26.683 PM] Received response 'textDocument/codeLens - (12)' in 0ms.
Result: null

[Trace - 23:50:28.385 PM] Sending request 'textDocument/hover - (13)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":335,"character":87}}

[Trace - 23:50:28.391 PM] Received response 'textDocument/hover - (13)' in 5ms.
Result: {"contents":{"kind":"markdown","value":"go\nstruct {\n\tStatusCheck int\n\tSerialNumber string\n\tUpdateSerialNumber bool\n\tCogs float64\n\tRevenue float64\n\tRC string\n}\n\n\nagent.CheckStatusResult on pkg.go.dev"},"range":{"start":{"line":335,"character":71},"end":{"line":335,"character":88}}}

[Trace - 23:50:30.065 PM] Sending request 'textDocument/hover - (14)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":23,"character":0}}

[Trace - 23:50:30.067 PM] Received response 'textDocument/hover - (14)' in 2ms.
Result: null

[Trace - 23:50:32.055 PM] Sending request 'textDocument/definition - (15)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":26}}

[Trace - 23:50:32.061 PM] Received response 'textDocument/definition - (15)' in 6ms.
Result: [{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}}]

[Trace - 23:50:32.565 PM] Sending request 'textDocument/codeAction - (16)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"range":{"start":{"line":1118,"character":1},"end":{"line":1118,"character":1}},"context":{"diagnostics":[]}}

[Trace - 23:50:32.584 PM] Received response 'textDocument/codeAction - (16)' in 18ms.
Result: null

[Trace - 23:50:32.758 PM] Sending request 'textDocument/definition - (17)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":25}}

[Trace - 23:50:32.760 PM] Received response 'textDocument/definition - (17)' in 1ms.
Result: [{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}}]

[Trace - 23:50:32.909 PM] Sending request 'textDocument/hover - (18)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":25}}

[Trace - 23:50:32.911 PM] Received response 'textDocument/hover - (18)' in 2ms.
Result: {"contents":{"kind":"markdown","value":"go\nfunc (*ModuleImpl).isEligible(reqType requestType, orderAgentReqStr *entity.Order) (int64, error)\n"},"range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}}

[Trace - 23:50:33.028 PM] Sending request 'textDocument/documentHighlight - (19)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":26}}

[Trace - 23:50:33.029 PM] Received response 'textDocument/documentHighlight - (19)' in 0ms.
Result: [{"range":{"start":{"line":358,"character":16},"end":{"line":358,"character":26}},"kind":1},{"range":{"start":{"line":868,"character":23},"end":{"line":868,"character":33}},"kind":1},{"range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}},"kind":1}]

[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tdirectory=/home/nakama/workspace/tokopedia/rechargeapp\n\tquery=[github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/util/sftp github.com/tokopedia/rechargeapp/util/sftp]\n\tpackages=2\n"}

[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tpackage_path="github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie"\n\tfiles=[]\n"}

[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tpackage_path="github.com/tokopedia/rechargeapp/util/sftp"\n\tfiles=[]\n"}

[Info - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load
snapshot=8
directory=/home/nakama/workspace/tokopedia/rechargeapp
query=[github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/util/sftp github.com/tokopedia/rechargeapp/util/sftp]
packages=2

[Info - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load
snapshot=8
package_path="github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie"
files=[]

[Info - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load
snapshot=8
package_path="github.com/tokopedia/rechargeapp/util/sftp"
files=[]

[Trace - 23:50:33.135 PM] Received notification 'window/showMessage'.
Params: {"type":1,"message":"The code in the workspace failed to compile (see the error message below).\nIf you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new.\ngithub.com/tokopedia/rechargeapp/src/recharge/tkpdrichie [github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie.test] has no metadata"}

[Trace - 23:50:33.135 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/08/13 23:50:33 The code in the workspace failed to compile (see the error message below).\nIf you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new.: github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie [github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie.test] has no metadata\n\tsnapshot=8\n\tdirectory=file:///home/nakama/workspace/tokopedia/rechargeapp\n"}

[Error - 11:50:33 PM] 2020/08/13 23:50:33 The code in the workspace failed to compile (see the error message below).
If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new.: github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie [github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie.test] has no metadata
snapshot=8
directory=file:///home/nakama/workspace/tokopedia/rechargeapp

[Trace - 23:50:33.165 PM] Sending request 'textDocument/definition - (20)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":26}}

[Trace - 23:50:33.165 PM] Received response 'textDocument/definition - (20)' in 0ms.
Result: [{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}}]

[Trace - 23:50:33.168 PM] Sending request 'textDocument/references - (21)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"position":{"line":1087,"character":26},"context":{"includeDeclaration":true}}

[Trace - 23:50:33.172 PM] Received response 'textDocument/references - (21)' in 4ms.
Result: [{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":31}}},{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":358,"character":16},"end":{"line":358,"character":26}}},{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go","range":{"start":{"line":868,"character":23},"end":{"line":868,"character":33}}},{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main_test.go","range":{"start":{"line":1433,"character":22},"end":{"line":1433,"character":32}}}]

[Trace - 23:50:33.223 PM] Sending request 'textDocument/documentLink - (22)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:33.223 PM] Sending request 'textDocument/codeAction - (23)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 23:50:33.230 PM] Received response 'textDocument/documentLink - (22)' in 6ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":15}},"target":"https://pkg.go.dev/encoding/json"},{"range":{"start":{"line":4,"character":2},"end":{"line":4,"character":8}},"target":"https://pkg.go.dev/errors"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":5}},"target":"https://pkg.go.dev/fmt"},{"range":{"start":{"line":6,"character":2},"end":{"line":6,"character":9}},"target":"https://pkg.go.dev/strings"},{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":6}},"target":"https://pkg.go.dev/time"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":42}},"target":"https://pkg.go.dev/github.com/eapache/go-resiliency@v1.1.0/breaker"},{"range":{"start":{"line":10,"character":2},"end":{"line":10,"character":52}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/internal/constant"},{"range":{"start":{"line":11,"character":2},"end":{"line":11,"character":50}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/internal/entity"},{"range":{"start":{"line":12,"character":2},"end":{"line":12,"character":43}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/localize"},{"range":{"start":{"line":13,"character":2},"end":{"line":13,"character":44}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/agent"},{"range":{"start":{"line":14,"character":10},"end":{"line":14,"character":55}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/agent/rc"},{"range":{"start":{"line":15,"character":2},"end":{"line":15,"character":45}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/common"},{"range":{"start":{"line":16,"character":2},"end":{"line":16,"character":54}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/frontend/global"},{"range":{"start":{"line":17,"character":2},"end":{"line":17,"character":42}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/lib"},{"range":{"start":{"line":18,"character":11},"end":{"line":18,"character":49}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/state"},{"range":{"start":{"line":19,"character":2},"end":{"line":19,"character":47}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/convert"},{"range":{"start":{"line":20,"character":2},"end":{"line":20,"character":46}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/format"},{"range":{"start":{"line":21,"character":2},"end":{"line":21,"character":49}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/util/validator"}]

[Trace - 23:50:33.235 PM] Received response 'textDocument/codeAction - (23)' in 11ms.
Result: null

[Trace - 23:50:33.274 PM] Sending request 'textDocument/codeAction - (24)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"range":{"start":{"line":1087,"character":26},"end":{"line":1087,"character":26}},"context":{"diagnostics":[]}}

[Trace - 23:50:33.282 PM] Received response 'textDocument/codeAction - (24)' in 7ms.
Result: null

[Trace - 23:50:33.419 PM] Sending request 'textDocument/foldingRange - (25)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:33.438 PM] Received response 'textDocument/foldingRange - (25)' in 18ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":21,"endCharacter":50,"kind":"imports"},{"startLine":24,"startCharacter":51,"endLine":69,"endCharacter":32},{"startLine":27,"startCharacter":16,"endLine":30,"endCharacter":16},{"startLine":34,"startCharacter":22,"endLine":36,"endCharacter":12},{"startLine":39,"startCharacter":16,"endLine":42,"endCharacter":16},{"startLine":46,"startCharacter":46,"endLine":50,"endCharacter":16},{"startLine":55,"startCharacter":16,"endLine":58,"endCharacter":16},{"startLine":63,"startCharacter":16,"endLine":66,"endCharacter":16},{"startLine":72,"startCharacter":95,"endLine":171,"endCharacter":19},{"startLine":73,"startCharacter":6,"endLine":75,"endCharacter":13},{"startLine":78,"startCharacter":29,"endLine":79,"endCharacter":20},{"startLine":81,"startCharacter":33,"endLine":83,"endCharacter":21},{"startLine":86,"startCharacter":15,"endLine":101,"endCharacter":4},{"startLine":87,"startCharacter":44,"endLine":100,"endCharacter":41},{"startLine":105,"startCharacter":16,"endLine":107,"endCharacter":20},{"startLine":111,"startCharacter":16,"endLine":113,"endCharacter":20},{"startLine":116,"startCharacter":26,"endLine":121,"endCharacter":26},{"startLine":132,"startCharacter":16,"endLine":134,"endCharacter":20},{"startLine":135,"startCharacter":60,"endLine":157,"endCharacter":20},{"startLine":137,"startCharacter":31,"endLine":146,"endCharacter":28},{"startLine":151,"startCharacter":24,"endLine":152,"endCharacter":29},{"startLine":153,"startCharacter":10,"endLine":154,"endCharacter":40},{"startLine":164,"startCharacter":16,"endLine":166,"endCharacter":20},{"startLine":174,"startCharacter":107,"endLine":332,"endCharacter":19},{"startLine":175,"startCharacter":6,"endLine":201,"endCharacter":24},{"startLine":176,"startCharacter":39,"endLine":180,"endCharacter":20},{"startLine":189,"startCharacter":40,"endLine":197,"endCharacter":39},{"startLine":205,"startCharacter":16,"endLine":207,"endCharacter":20},{"startLine":217,"startCharacter":16,"endLine":219,"endCharacter":20},{"startLine":224,"startCharacter":16,"endLine":226,"endCharacter":20},{"startLine":229,"startCharacter":26,"endLine":239,"endCharacter":26},{"startLine":243,"startCharacter":16,"endLine":246,"endCharacter":22},{"startLine":247,"startCharacter":9,"endLine":288,"endCharacter":3},{"startLine":248,"startCharacter":70,"endLine":267,"endCharacter":4},{"startLine":250,"startCharacter":18,"endLine":252,"endCharacter":49},{"startLine":253,"startCharacter":11,"endLine":266,"endCharacter":5},{"startLine":258,"startCharacter":58,"endLine":265,"endCharacter":24},{"startLine":268,"startCharacter":10,"endLine":287,"endCharacter":4},{"startLine":270,"startCharacter":32,"endLine":279,"endCharacter":40},{"startLine":285,"startCharacter":21,"endLine":286,"endCharacter":50},{"startLine":291,"startCharacter":55,"endLine":312,"endCharacter":3},{"startLine":292,"startCharacter":58,"endLine":293,"endCharacter":55,"kind":"comment"},{"startLine":298,"startCharacter":33,"endLine":306,"endCharacter":46},{"startLine":309,"startCharacter":62,"endLine":311,"endCharacter":51},{"startLine":315,"startCharacter":35,"endLine":325,"endCharacter":38},{"startLine":328,"startCharacter":74,"endLine":329,"endCharacter":141},{"startLine":335,"startCharacter":98,"endLine":488,"endCharacter":19},{"startLine":336,"startCharacter":35,"endLine":341,"endCharacter":26},{"startLine":344,"startCharacter":6,"endLine":355,"endCharacter":37},{"startLine":359,"startCharacter":16,"endLine":361,"endCharacter":20},{"startLine":365,"startCharacter":16,"endLine":367,"endCharacter":20},{"startLine":371,"startCharacter":16,"endLine":373,"endCharacter":20},{"startLine":377,"startCharacter":16,"endLine":379,"endCharacter":20},{"startLine":382,"startCharacter":25,"endLine":393,"endCharacter":26},{"startLine":398,"startCharacter":16,"endLine":403,"endCharacter":45},{"startLine":404,"startCharacter":79,"endLine":424,"endCharacter":3},{"startLine":406,"startCharacter":17,"endLine":408,"endCharacter":48},{"startLine":409,"startCharacter":10,"endLine":423,"endCharacter":4},{"startLine":415,"startCharacter":57,"endLine":422,"endCharacter":23},{"startLine":425,"startCharacter":9,"endLine":444,"endCharacter":3},{"startLine":427,"startCharacter":31,"endLine":436,"endCharacter":39},{"startLine":442,"startCharacter":20,"endLine":443,"endCharacter":49},{"startLine":447,"startCharacter":52,"endLine":468,"endCharacter":3},{"startLine":448,"startCharacter":58,"endLine":449,"endCharacter":55,"kind":"comment"},{"startLine":454,"startCharacter":33,"endLine":462,"endCharacter":46},{"startLine":465,"startCharacter":62,"endLine":467,"endCharacter":50},{"startLine":471,"startCharacter":35,"endLine":481,"endCharacter":37},{"startLine":484,"startCharacter":74,"endLine":485,"endCharacter":140},{"startLine":491,"startCharacter":105,"endLine":627,"endCharacter":19},{"startLine":492,"startCharacter":6,"endLine":517,"endCharacter":3},{"startLine":493,"startCharacter":46,"endLine":494,"endCharacter":21},{"startLine":502,"startCharacter":26,"endLine":505,"endCharacter":29},{"startLine":510,"startCharacter":33,"endLine":516,"endCharacter":21},{"startLine":512,"startCharacter":18,"endLine":514,"endCharacter":48},{"startLine":521,"startCharacter":15,"endLine":540,"endCharacter":4},{"startLine":523,"startCharacter":17,"endLine":524,"endCharacter":23},{"startLine":526,"startCharacter":44,"endLine":539,"endCharacter":39},{"startLine":545,"startCharacter":16,"endLine":548,"endCharacter":20},{"startLine":553,"startCharacter":16,"endLine":556,"endCharacter":20},{"startLine":570,"startCharacter":16,"endLine":573,"endCharacter":20},{"startLine":582,"startCharacter":33,"endLine":611,"endCharacter":20},{"startLine":583,"startCharacter":31,"endLine":592,"endCharacter":28},{"startLine":606,"startCharacter":24,"endLine":608,"endCharacter":28},{"startLine":620,"startCharacter":16,"endLine":623,"endCharacter":20},{"startLine":630,"startCharacter":117,"endLine":815,"endCharacter":19},{"startLine":631,"startCharacter":6,"endLine":653,"endCharacter":25},{"startLine":632,"startCharacter":39,"endLine":636,"endCharacter":20},{"startLine":646,"startCharacter":26,"endLine":651,"endCharacter":29},{"startLine":657,"startCharacter":15,"endLine":675,"endCharacter":3},{"startLine":658,"startCharacter":17,"endLine":659,"endCharacter":30},{"startLine":661,"startCharacter":36,"endLine":671,"endCharacter":39},{"startLine":673,"startCharacter":75,"endLine":674,"endCharacter":118},{"startLine":679,"startCharacter":32,"endLine":687,"endCharacter":38},{"startLine":690,"startCharacter":16,"endLine":693,"endCharacter":20},{"startLine":705,"startCharacter":16,"endLine":708,"endCharacter":20},{"startLine":725,"startCharacter":16,"endLine":729,"endCharacter":20},{"startLine":734,"startCharacter":16,"endLine":738,"endCharacter":20},{"startLine":743,"startCharacter":16,"endLine":747,"endCharacter":20},{"startLine":755,"startCharacter":33,"endLine":776,"endCharacter":20},{"startLine":756,"startCharacter":31,"endLine":765,"endCharacter":39},{"startLine":769,"startCharacter":20,"endLine":770,"endCharacter":53},{"startLine":781,"startCharacter":16,"endLine":786,"endCharacter":20},{"startLine":794,"startCharacter":55,"endLine":812,"endCharacter":3},{"startLine":799,"startCharacter":33,"endLine":807,"endCharacter":46},{"startLine":809,"startCharacter":62,"endLine":811,"endCharacter":52},{"startLine":818,"startCharacter":110,"endLine":1009,"endCharacter":19},{"startLine":819,"startCharacter":6,"endLine":842,"endCharacter":26},{"startLine":820,"startCharacter":35,"endLine":825,"endCharacter":27},{"startLine":835,"startCharacter":27,"endLine":840,"endCharacter":29},{"startLine":846,"startCharacter":15,"endLine":864,"endCharacter":3},{"startLine":847,"startCharacter":17,"endLine":848,"endCharacter":30},{"startLine":850,"startCharacter":36,"endLine":860,"endCharacter":40},{"startLine":862,"startCharacter":75,"endLine":863,"endCharacter":119},{"startLine":869,"startCharacter":16,"endLine":873,"endCharacter":20},{"startLine":878,"startCharacter":16,"endLine":882,"endCharacter":20},{"startLine":888,"startCharacter":16,"endLine":892,"endCharacter":20},{"startLine":908,"startCharacter":16,"endLine":912,"endCharacter":20},{"startLine":920,"startCharacter":16,"endLine":923,"endCharacter":20},{"startLine":928,"startCharacter":16,"endLine":932,"endCharacter":20},{"startLine":940,"startCharacter":33,"endLine":944,"endCharacter":20},{"startLine":948,"startCharacter":43,"endLine":971,"endCharacter":20},{"startLine":949,"startCharacter":31,"endLine":958,"endCharacter":43},{"startLine":962,"startCharacter":20,"endLine":963,"endCharacter":53},{"startLine":977,"startCharacter":16,"endLine":979,"endCharacter":68},{"startLine":987,"startCharacter":52,"endLine":1006,"endCharacter":3},{"startLine":993,"startCharacter":33,"endLine":1001,"endCharacter":46},{"startLine":1003,"startCharacter":62,"endLine":1005,"endCharacter":52},{"startLine":1012,"startCharacter":74,"endLine":1030,"endCharacter":17},{"startLine":1014,"startCharacter":25,"endLine":1019,"endCharacter":18},{"startLine":1024,"startCharacter":16,"endLine":1027,"endCharacter":16},{"startLine":1033,"startCharacter":65,"endLine":1057,"endCharacter":18},{"startLine":1035,"startCharacter":16,"endLine":1036,"endCharacter":54},{"startLine":1040,"startCharacter":28,"endLine":1046,"endCharacter":3},{"startLine":1042,"startCharacter":17,"endLine":1045,"endCharacter":17},{"startLine":1051,"startCharacter":16,"endLine":1054,"endCharacter":19},{"startLine":1060,"startCharacter":83,"endLine":1064,"endCharacter":11},{"startLine":1061,"startCharacter":34,"endLine":1062,"endCharacter":41},{"startLine":1067,"startCharacter":95,"endLine":1084,"endCharacter":7},{"startLine":1068,"startCharacter":16,"endLine":1071,"endCharacter":8},{"startLine":1074,"startCharacter":35,"endLine":1078,"endCharacter":8},{"startLine":1087,"startCharacter":101,"endLine":1117,"endCharacter":18},{"startLine":1088,"startCharacter":6,"endLine":1091,"endCharacter":43},{"startLine":1095,"startCharacter":9,"endLine":1096,"endCharacter":15},{"startLine":1101,"startCharacter":23,"endLine":1102,"endCharacter":98},{"startLine":1108,"startCharacter":16,"endLine":1109,"endCharacter":15},{"startLine":1113,"startCharacter":28,"endLine":1114,"endCharacter":128}]

[Trace - 23:50:33.469 PM] Sending request 'textDocument/codeLens - (26)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"}}

[Trace - 23:50:33.469 PM] Received response 'textDocument/codeLens - (26)' in 0ms.
Result: null

[Trace - 23:50:33.474 PM] Sending request 'textDocument/codeAction - (27)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/recharge/bukopin/main.go"},"range":{"start":{"line":1087,"character":21},"end":{"line":1087,"character":21}},"context":{"diagnostics":[]}}

[Trace - 23:50:33.482 PM] Received response 'textDocument/codeAction - (27)' in 8ms.
Result: null

[Trace - 23:50:36.010 PM] Sending request 'textDocument/documentLink - (28)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"}}

[Trace - 23:50:36.010 PM] Sending request 'textDocument/codeAction - (29)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 23:50:36.013 PM] Received response 'textDocument/documentLink - (28)' in 2ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":5}},"target":"https://pkg.go.dev/fmt"},{"range":{"start":{"line":4,"character":2},"end":{"line":4,"character":5}},"target":"https://pkg.go.dev/log"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":6}},"target":"https://pkg.go.dev/time"},{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":43}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/localize"},{"range":{"start":{"line":8,"character":2},"end":{"line":8,"character":45}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/common"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":42}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/lib"},{"range":{"start":{"line":10,"character":2},"end":{"line":10,"character":48}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/src/reconcile"},{"range":{"start":{"line":11,"character":11},"end":{"line":11,"character":49}},"target":"https://pkg.go.dev/github.com/tokopedia/rechargeapp/state"}]

[Trace - 23:50:36.036 PM] Received response 'textDocument/codeAction - (29)' in 26ms.
Result: null

[Trace - 23:50:36.182 PM] Sending request 'textDocument/foldingRange - (30)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"}}

[Trace - 23:50:36.184 PM] Received response 'textDocument/foldingRange - (30)' in 1ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":11,"endCharacter":50,"kind":"imports"},{"startLine":15,"startCharacter":48,"endLine":22,"endCharacter":3},{"startLine":16,"startCharacter":67,"endLine":17,"endCharacter":43},{"startLine":20,"startCharacter":66,"endLine":21,"endCharacter":49},{"startLine":26,"startCharacter":49,"endLine":43,"endCharacter":7},{"startLine":29,"startCharacter":15,"endLine":35,"endCharacter":3},{"startLine":30,"startCharacter":17,"endLine":34,"endCharacter":4},{"startLine":31,"startCharacter":41,"endLine":33,"endCharacter":111},{"startLine":39,"startCharacter":16,"endLine":40,"endCharacter":64},{"startLine":46,"startCharacter":35,"endLine":71,"endCharacter":7},{"startLine":49,"startCharacter":42,"endLine":54,"endCharacter":3},{"startLine":51,"startCharacter":17,"endLine":53,"endCharacter":9},{"startLine":58,"startCharacter":16,"endLine":60,"endCharacter":8},{"startLine":63,"startCharacter":16,"endLine":68,"endCharacter":3},{"startLine":65,"startCharacter":40,"endLine":67,"endCharacter":109}]

[Trace - 23:50:36.243 PM] Sending request 'textDocument/codeLens - (31)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"}}

[Trace - 23:50:36.243 PM] Received response 'textDocument/codeLens - (31)' in 0ms.
Result: null

[Trace - 23:50:36.244 PM] Sending request 'textDocument/codeAction - (32)'.
Params: {"textDocument":{"uri":"file:///home/nakama/workspace/tokopedia/rechargeapp/src/background/c_agent_bukopin.go"},"range":{"start":{"line":26,"character":46},"end":{"line":26,"character":46}},"context":{"diagnostics":[]}}

[Trace - 23:50:36.268 PM] Received response 'textDocument/codeAction - (32)' in 23ms.
Result: null

@stamblerre
Copy link
Contributor

Thanks for the log! Looks like gopls was having a hard time loading github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie. Did this package exist or was it a new package you were working on?

In the excerpt below, you see the logs that gopls isn't able to find any files associated with the package.
One strange thing is the duplication of the package path in the query - we should probably use a map for those.

[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.

Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tdirectory=/home/nakama/workspace/tokopedia/rechargeapp\n\tquery=[github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/util/sftp github.com/tokopedia/rechargeapp/util/sftp]\n\tpackages=2\n"}


[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.

Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tpackage_path="github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie"\n\tfiles=[]\n"}


[Trace - 23:50:33.111 PM] Received notification 'window/logMessage'.

Params: {"type":3,"message":"2020/08/13 23:50:33 go/packages.Load\n\tsnapshot=8\n\tpackage_path="github.com/tokopedia/rechargeapp/util/sftp"\n\tfiles=[]\n"}


[Info  - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load

snapshot=8

directory=/home/nakama/workspace/tokopedia/rechargeapp

query=[github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie github.com/tokopedia/rechargeapp/util/sftp github.com/tokopedia/rechargeapp/util/sftp]

packages=2


[Info  - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load

snapshot=8

package_path="github.com/tokopedia/rechargeapp/src/recharge/tkpdrichie"

files=[]


[Info  - 11:50:33 PM] 2020/08/13 23:50:33 go/packages.Load

snapshot=8

package_path="github.com/tokopedia/rechargeapp/util/sftp"

files=[]

@gopherbot
Copy link

Change https://golang.org/cl/248403 mentions this issue: internal/lsp/cache: use a map to track package paths to reload

@leguminosa
Copy link
Author

that package (tkpdrichie) is the work from other developer, and it only exist in staging branch (for development).

Perhaps when I check out back to my feature branch (that does not have tkpdrichie), smh vscode still take tkpdrichie into account?

@stamblerre
Copy link
Contributor

It's definitely possible that gopls was trying to load a package that no longer existed on disk, but I would need the full gopls log to see if gopls received the didChangeWatchedFile notification for that package. There's also a chance that you encountered a bug in VS Code's file watching--we've noticed a few issues in the recent days. Do you still have access to the full gopls log from that VS Code session?

We should definitely add a regression test for a workspace package deletion, if we don't already have one.

@leguminosa
Copy link
Author

I think the log above is already all log from that session, I selected all then pasted it here.

But I'll give you the logs again should I encounter the error again on my next session.

@stamblerre
Copy link
Contributor

gopls logs start with a series of initialization requests, so make sure to look for those when capturing the full log. Thanks!

@leguminosa
Copy link
Author

ok, I'll look into it, thanks.

gopherbot pushed a commit to golang/tools that referenced this issue Aug 14, 2020
I could've sworn I'd already submitted this CL earlier. We've been
sending duplicate package paths to go/packages for no reason.

Updates golang/go#40690

Change-Id: I4c0d082a71e53df12991341b015e0ce8f504c318
Reviewed-on: https://go-review.googlesource.com/c/tools/+/248403
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@cretz
Copy link

cretz commented Aug 21, 2020

I am experiencing this issue and have narrowed down when it occurs. It occurs whenever you have a package where the only test files are in package _test instead of the same package as the rest of the files. For example, if you have foo/foo.go with package foo, and foo/foo_test.go as package foo_test, this error will come up as:

The code in the workspace failed to compile (see the error message below).
If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new.
path/to/foo [path/to/foo.test] has no metadata

But if you make any test in that same dir that uses the same package (e.g. foo/bar_test.go with package foo) it will work. From the outside, it makes sense from the message why this bug exists. The tool is erroneously looking for a foo.test package if any test is present, not realizing that all tests might be in a separate foo_test.test package.

EDIT: To repeatedly replicate after a restart/reload, you may have to create that foo/bar_test.go with package foo, then delete it.

@stamblerre stamblerre removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 26, 2020
@stamblerre
Copy link
Contributor

Thanks for the repro case, @cretz. I am able to reproduce. I think that https://golang.org/cl/250949 should fix the pop-up, but I'll investigate the underlying causes here.

@stamblerre stamblerre added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 27, 2020
@stamblerre stamblerre changed the title x/tools/gopls: error message pop-up "The code in the workspace failed to compile" x/tools/gopls: no metadata for test variants in packages with only x tests Aug 27, 2020
@stamblerre stamblerre changed the title x/tools/gopls: no metadata for test variants in packages with only x tests x/tools/gopls: remove workspace packages that no longer exist Aug 27, 2020
@gopherbot
Copy link

Change https://golang.org/cl/251017 mentions this issue: internal/lsp/regtest: reproduce edge cases when creating new files

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v1.0.0 Aug 27, 2020
gopherbot pushed a commit to golang/tools that referenced this issue Sep 2, 2020
This adds tests for golang/go#40690, as well as a case for a bug in
changing package names.

Updates golang/go#40690

Change-Id: I516404e77728024f8bee3da31a88bad1f1917a9b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251017
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Nov 10, 2020
@stamblerre stamblerre moved this from Needs Triage to Critical in vscode-go: gopls by default Nov 10, 2020
@stamblerre stamblerre self-assigned this Nov 11, 2020
@stamblerre stamblerre moved this from Critical to In progress in vscode-go: gopls by default Nov 11, 2020
@gopherbot
Copy link

Change https://golang.org/cl/268157 mentions this issue: internal/lsp: remove workspace packages as needed

vscode-go: gopls by default automation moved this from In progress to Done Nov 20, 2020
@golang golang locked and limited conversation to collaborators Nov 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
No open projects
Development

No branches or pull requests

6 participants