Some comments

This commit is contained in:
Melon 2023-11-25 12:59:09 +00:00
parent d970469645
commit 19a112ed2d
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ func main() {
return
}
// load config file
openConf, err := os.Open(configPath)
if err != nil {
if os.IsNotExist(err) {
@ -33,6 +34,7 @@ func main() {
return
}
// decode config file
var conf Conf
err = yaml.NewDecoder(openConf).Decode(&conf)
if err != nil {
@ -42,6 +44,7 @@ func main() {
wd := filepath.Dir(configPath)
// load mjwt public key
verify, err := mjwt.NewMJwtVerifierFromFile(filepath.Join(wd, "signer.public.pem"))
if err != nil {
log.Fatalf("[Lotus] Failed to load MJWT verifier public key from file '%s': %s", filepath.Join(wd, "signer.public.pem"), err)

View File

@ -36,11 +36,9 @@ func init() {
func TestSendMail_Send(t *testing.T) {
execCommand = func(name string, arg ...string) *exec.Cmd {
log.Println("Hello")
cs := append([]string{"-test.run=TestSendMailHelperProcess", "--", name}, arg...)
cmd := exec.Command(os.Args[0], cs...)
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
log.Println(cmd.Path)
return cmd
}
defer func() { execCommand = exec.Command }()