// example: open a file should exist(local config file),// if it not exists, then it's code error or CI/CD error, not runtime error.funcTestVerify(t *testing.T){file :=VerifyWithResult(os.Open("should_exist_conf_file"))deferfunc(){//Notice: when try to close a nil(*os.File), error with "invalid argument"_=Verify(file.Close())}()//file.Read(xxxx)}
运行效果(可以看到代码中没有写日志的代码,但是程序发生问题时,能快速定位)
2024/01/29 21:31:54 [WARN] /path/to/go-library/debugutil/verify_test.go:13 (TestVerify) FAIL(*fs.PathError), msg=open should_exist_conf_file: The system cannot find the file specified.
2024/01/29 21:31:54 [WARN] /path/to/go-library/debugutil/verify_test.go:17 (func1) FAIL(*errors.errorString), msg=invalid argument
AI视野今日CS.NLP 自然语言处理论文速览 Fri, 12 Jan 2024 Totally 60 papers 👉上期速览✈更多精彩请移步主页 Daily Computation and Language Papers
Axis Tour: Word Tour Determines the Order of Axes in ICA-transformed Embeddings Authors Hiroaki Yamagi…