Commit 4cc4256c authored by liuyuhang's avatar liuyuhang

modify md file

parent 91ee2d99
## 本地查看自己所修改模块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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment