Skip to content

Commit

Permalink
docs: add Windows environment example for generating Kitex mock client (
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuLian2000 authored Jan 22, 2025
1 parent b324caa commit d5fa85a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ Kitex mock 方式如下:

找到 kitex_gen 目录下的 client,里面有对应的 client 接口,用 go mock 生成 mock client

mac环境下:

```bash
mockgen -source=kitex_gen/xxxx/xxxservice/client.go -destination=xxx/client_mock.go -package=xxx
```

windows环境下:
```bash
mockgen -source kitex_gen/xxxx/xxxservice/client.go -destination xxx/client_mock.go -package xxx
```

该命令会生成 client_mock.go,在测试中使用即可:

```go
Expand Down

0 comments on commit d5fa85a

Please sign in to comment.