mirror of
https://github.com/1f349/lotus.git
synced 2024-12-22 16:14:07 +00:00
Some comments
This commit is contained in:
parent
d970469645
commit
19a112ed2d
@ -23,6 +23,7 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load config file
|
||||||
openConf, err := os.Open(configPath)
|
openConf, err := os.Open(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
@ -33,6 +34,7 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// decode config file
|
||||||
var conf Conf
|
var conf Conf
|
||||||
err = yaml.NewDecoder(openConf).Decode(&conf)
|
err = yaml.NewDecoder(openConf).Decode(&conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -42,6 +44,7 @@ func main() {
|
|||||||
|
|
||||||
wd := filepath.Dir(configPath)
|
wd := filepath.Dir(configPath)
|
||||||
|
|
||||||
|
// load mjwt public key
|
||||||
verify, err := mjwt.NewMJwtVerifierFromFile(filepath.Join(wd, "signer.public.pem"))
|
verify, err := mjwt.NewMJwtVerifierFromFile(filepath.Join(wd, "signer.public.pem"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("[Lotus] Failed to load MJWT verifier public key from file '%s': %s", filepath.Join(wd, "signer.public.pem"), err)
|
log.Fatalf("[Lotus] Failed to load MJWT verifier public key from file '%s': %s", filepath.Join(wd, "signer.public.pem"), err)
|
||||||
|
@ -36,11 +36,9 @@ func init() {
|
|||||||
|
|
||||||
func TestSendMail_Send(t *testing.T) {
|
func TestSendMail_Send(t *testing.T) {
|
||||||
execCommand = func(name string, arg ...string) *exec.Cmd {
|
execCommand = func(name string, arg ...string) *exec.Cmd {
|
||||||
log.Println("Hello")
|
|
||||||
cs := append([]string{"-test.run=TestSendMailHelperProcess", "--", name}, arg...)
|
cs := append([]string{"-test.run=TestSendMailHelperProcess", "--", name}, arg...)
|
||||||
cmd := exec.Command(os.Args[0], cs...)
|
cmd := exec.Command(os.Args[0], cs...)
|
||||||
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
||||||
log.Println(cmd.Path)
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
defer func() { execCommand = exec.Command }()
|
defer func() { execCommand = exec.Command }()
|
||||||
|
Loading…
Reference in New Issue
Block a user