优化代码

This commit is contained in:
GoEdgeLab
2022-03-22 19:30:30 +08:00
parent 31599bee13
commit 2b0e2b6888
90 changed files with 294 additions and 294 deletions

View File

@@ -5,22 +5,22 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
)
// 解析最小长度
// DecodeMinLength 解析最小长度
func (this *HTTPGzip) DecodeMinLength() (*shared.SizeCapacity, error) {
if len(this.MinLength) == 0 {
return nil, nil
}
capacity := &shared.SizeCapacity{}
err := json.Unmarshal([]byte(this.MinLength), capacity)
err := json.Unmarshal(this.MinLength, capacity)
return capacity, err
}
// 解析最大长度
// DecodeMaxLength 解析最大长度
func (this *HTTPGzip) DecodeMaxLength() (*shared.SizeCapacity, error) {
if len(this.MaxLength) == 0 {
return nil, nil
}
capacity := &shared.SizeCapacity{}
err := json.Unmarshal([]byte(this.MaxLength), capacity)
err := json.Unmarshal(this.MaxLength, capacity)
return capacity, err
}