Repository Details
Shared by
HelloGitHub Rating
0 ratings
一个封装好的 OS 三方库,解决了 Go 使用 OS 标准库错误处理的麻烦
Past 7 days Received 0 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 7,044 | — |
| 周三 | 7,044 | 0 |
| 周四 | 7,045 | +1 |
| 周五 | 7,044 | -1 |
| 周六 | 7,044 | 0 |
| 周日 | 7,045 | +1 |
| 周一 | 7,044 | -1 |
7k
Stars
No
Chinese
Go
Language
Yes
Active
21
Contributors
15
Issues
No
Organization
None
Latest
369
Forks
MIT
License
一个封装好的 OS 三方库,解决了 Go 使用 OS 标准库错误处理的麻烦。如果没有它,打开一个文件查找一个关键字再统计下数量,你至少会需要 2-3 个异常处理的逻辑。有了它,只需要:
```go
numErrors, err := script.File("test.txt").Match("Error").CountLines()
// 等同于 grep Error test.txt | wc -l
```
Included in:
Vol.39
Comments
Rating:
No comments yet