重构
This commit is contained in:
parent
7e15185359
commit
a1defc9aff
2
main.go
2
main.go
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"acme-client/src"
|
||||
"bufio"
|
||||
"github.com/go-acme/lego/v4/log"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
|
|
@ -135,7 +135,7 @@ func getCert() {
|
|||
}
|
||||
}
|
||||
if !isDoGet {
|
||||
log.Println("日志文件已存在, 无需更新.\n如果需要强制更新, 请使用命令: get -f")
|
||||
fmt.Println("日志文件已存在, 无需更新.\n如果需要强制更新, 请使用命令: get -f")
|
||||
return
|
||||
}
|
||||
domainData, err := doGetCert(domain.Name)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package src
|
||||
|
||||
import (
|
||||
"github.com/go-acme/lego/v4/log"
|
||||
"github.com/go-acme/lego/v4/platform/config/env"
|
||||
"gopkg.in/yaml.v3"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
@ -26,7 +26,7 @@ func InitConfig() {
|
|||
_, err := os.Stat(confFile)
|
||||
|
||||
if os.IsNotExist(err) {
|
||||
log.Infof("客户端配置文件不存在,自动创建默认配置文件")
|
||||
log.Println("客户端配置文件不存在,自动创建默认配置文件")
|
||||
conf := defaultConfig()
|
||||
file, err := os.Create(confFile)
|
||||
if err != nil {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"github.com/go-acme/lego/v4/log"
|
||||
"log"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user