Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Dec 7, 2024
1 parent 36abce6 commit 352d009
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tool/encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

var (
defaultEncoding = NewEncoding()
defaultEncoding = New()
)

/**
Expand All @@ -20,7 +20,7 @@ var (
type Encoding struct{}

// 构造函数
func NewEncoding() *Encoding {
func New() *Encoding {
return &Encoding{}
}

Expand Down
2 changes: 1 addition & 1 deletion tool/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Errors struct {
}

// 构造函数
func NewErrors(errs []error) *Errors {
func New(errs []error) *Errors {
e := &Errors{
errs: make([]error, 0),
}
Expand Down
4 changes: 2 additions & 2 deletions tool/pem/pem.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
)

// BlockType 列表
var PemBlockTypeMap = map[string]string{
var PEMTypeMap = map[string]string{
"pri_key": "PRIVATE KEY",
"en_pri_key": "ENCRYPTED PRIVATE KEY",
"pub_key": "PUBLIC KEY",
Expand All @@ -37,7 +37,7 @@ var PemBlockTypeMap = map[string]string{

// 获取 PEM 类型
func GetPEMType(name string) string {
if data, ok := PemBlockTypeMap[name]; ok {
if data, ok := PEMTypeMap[name]; ok {
return data
}

Expand Down

0 comments on commit 352d009

Please sign in to comment.