-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
## example | ||
|
||
这个目录示范了如何正确编写代码来使用 go-decorator 工具。 | ||
这个目录示范了如何正确编写代码来使用 go-decorator 工具。 | ||
|
||
| Project | Notes | | ||
|-----------------------------------|-----------------------------------------------------------| | ||
| [**single**](example/single) | 这个一个单文件示例,装饰器定义和被装饰的函数都位于一个包内。这种情况无需考虑导入依赖包的问题,按示例代码使用即可。 | | ||
| [**packages**](example/packages) | 该项目示例为装饰器定义和被装饰的函数不在同一个包内,需要使用匿名包导入。 | | ||
| [**datetime**](example/datetime) | Guide 里演示示例所用到的完整代码 | | ||
| [**emptyfunc**](example/emptyfunc) | 演示装饰器中调用和不调用`TargetDo()` 的区别 | | ||
|
||
**single**: 这个一个单文件示例,装饰器定义和被装饰的函数都位于一个包内。这种情况无需考虑导入依赖包的问题,按示例代码使用即可。 | ||
|
||
**packages**:该项目示例为装饰器定义和被装饰的函数不在同一个包内,需要明确表明导入相关包来帮助工具编译时导入。 |