Skip to content

Commit

Permalink
doc: update to v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin-Huang committed Aug 8, 2022
1 parent ae596ce commit 3593227
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ A command-line tool to generate constructor code for a struct. It doesn't need m
Just add this comment line to the struct you want to generate a constructor. It doesn't need a manual installation.

```go
//go:generate go run github.com/Bin-Huang/[email protected].0
//go:generate go run github.com/Bin-Huang/[email protected].1
```

For example:

```go
//go:generate go run github.com/Bin-Huang/[email protected].0
//go:generate go run github.com/Bin-Huang/[email protected].1
type UserService struct {
baseService
userRepository *repositories.UserRepository
Expand Down Expand Up @@ -65,7 +65,7 @@ type UserService struct {
2. Write an `init` method for the struct

```go
//go:generate go run github.com/Bin-Huang/[email protected].0 --init
//go:generate go run github.com/Bin-Huang/[email protected].1 --init
type Controller struct {
logger *zap.Logger
debug bool
Expand Down
6 changes: 3 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Doc: [English](README.md) | **中文**
它的使用方式非常简单,不用专门手动安装,只需要在结构体添加下面这行代码注释就能工作。

```go
//go:generate go run github.com/Bin-Huang/[email protected].0
//go:generate go run github.com/Bin-Huang/[email protected].1
```

举个例子:

```go
//go:generate go run github.com/Bin-Huang/[email protected].0
//go:generate go run github.com/Bin-Huang/[email protected].1
type UserService struct {
baseService
userRepository *repositories.UserRepository
Expand Down Expand Up @@ -67,7 +67,7 @@ type UserService struct {
2. 为结构体实现一个 `init` 方法

```go
//go:generate go run github.com/Bin-Huang/[email protected].0 --init
//go:generate go run github.com/Bin-Huang/[email protected].1 --init
type Controller struct {
logger *zap.Logger
debug bool
Expand Down

0 comments on commit 3593227

Please sign in to comment.