Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bookmark
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuyuhang
bookmark
Commits
4cc4256c
Commit
4cc4256c
authored
Nov 14, 2018
by
liuyuhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify md file
parent
91ee2d99
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
lint_warning处理.md
lint_warning处理.md
+13
-4
No files found.
lint_warning处理.md
View file @
4cc4256c
## 本地
查看自己所修改模块lint warning的命令:
## 本地
查看自己所修改模块lint warning的命令:
...
...
@@ -5,7 +5,6 @@
### 1、导出结构体、变量、常量、函数需加注释
> * lint warning: exported const HashSize should have comment or be unexported
```
注释格式:
const (
// KeyWalletPassKey .......
KeyWalletPassKey = "WalletPassKey"
...
...
@@ -15,7 +14,7 @@ func CalcWalletPassKey() []byte {
return []byte(keyWalletPassKey)
}
```
>
**注:如果是某些函数或者变量没有必要exported的话,首字母改为小写就不需要注释了**
**注:如果是某些函数或者变量没有必要exported的话,首字母改为小写就不需要注释了**
```
func calcWalletPassKey() []byte {
return []byte(keyWalletPassKey)
...
...
@@ -31,7 +30,9 @@ var (
currentHeight int64 = 0
currentIndex int64 = 0
)
改为
```
改为:
```
var (
currentHeight int64
currentIndex int64
...
...
@@ -50,7 +51,9 @@ var (
return nil, err
}
}
```
改为:
```
if head == nil {
blockhight := chain.GetBlockHeight()
tmpHead, err := chain.blockStore.GetBlockHeaderByHeight(blockhight)
...
...
@@ -65,7 +68,9 @@ var (
> * lint warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self"
```
func (this *UpdateInitFileTask) genInitFile() error {}
```
改为:
```
func (up *UpdateInitFileTask) genInitFile() error {}
```
### 6、使用自加格式
...
...
@@ -84,7 +89,9 @@ func (store *walletStore) GetFeeAmount(minFee int64) int64 {
....
return FeeAmount
}
```
改为:
```
func (ws *walletStore) SetFeeAmount(FeeAmount int64) error {
....
return nil
...
...
@@ -101,7 +108,9 @@ func (ws *walletStore) GetFeeAmount(minFee int64) int64 {
if index < 0 {
return errors.New(fmt.Sprintf("Action %s Not Existed", this.ActionName))
}
```
改为:
```
index := strings.Index(context, this.ActionName)
if index < 0 {
return fmt.Errorf("Action %s Not Existed", this.ActionName)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment