Skip to content

[Issue] cannot use _ as value or type #10

@LingLuoYi

Description

@LingLuoYi

描述问题 · Describe the bug
After modifying the code and running it with -toolexec decorator, the error "cannot use _ as value or type" appears
期望 · Expected behavior
Normal operation

环境 (选其一) · Env (please complete the following information):

  • OS: Linux
  • Go: 1.23
  • go-decorator: 0.21.0

最小化可复现代码 · Minimize reproducible code
在这里贴代码或者提供代码仓库地址 · There is a code here or a link to code (), ref.

import (
      _ "github.com/dengsgo/go-decorator/decor"
     _ "leeks/user/internal/aop"
)
//go:decor aop.Get
func (l *GetLoginNonceLogic) GetLoginNonce(_ *pb.Empty) (*pb.LoginNonceResp, error) {
	randomString := xutils.GenerateRandomString(64)
	if err := l.svcCtx.Redis.Set(l.ctx, randomString, 0x1, 10*time.Minute).Err(); err != nil {
		return nil, status.Error(xcode.CommonError, err.Error())
	}
	return &pb.LoginNonceResp{
		Nonce: randomString,
	}, nil
}

编译执行的命令 · Build command
提供报错所执行的命令 · Commands executed by the compiled code。

go run -toolexec decorator service.go 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions