♻️ Refactor Go to err != nil, err == nil (#12385)

This commit is contained in:
Oleksandr Redko 2024-09-04 04:40:50 +03:00 committed by GitHub
parent 473a159ef2
commit b100721fee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 1661 additions and 1659 deletions

View file

@ -46,7 +46,7 @@ func GetEmbedBlockRef(embedNode *ast.Node) (blockRefID string) {
stmt := scriptNode.TokensStr()
parsedStmt, err := sqlparser.Parse(stmt)
if nil != err {
if err != nil {
return
}
@ -116,7 +116,7 @@ func IsEmbedBlockRef(n *ast.Node) bool {
func FormatNode(node *ast.Node, luteEngine *lute.Lute) string {
markdown, err := lute.FormatNodeSync(node, luteEngine.ParseOptions, luteEngine.RenderOptions)
if nil != err {
if err != nil {
root := TreeRoot(node)
logging.LogFatalf(logging.ExitCodeFatal, "format node [%s] in tree [%s] failed: %s", node.ID, root.ID, err)
}
@ -125,7 +125,7 @@ func FormatNode(node *ast.Node, luteEngine *lute.Lute) string {
func ExportNodeStdMd(node *ast.Node, luteEngine *lute.Lute) string {
markdown, err := lute.ProtyleExportMdNodeSync(node, luteEngine.ParseOptions, luteEngine.RenderOptions)
if nil != err {
if err != nil {
root := TreeRoot(node)
logging.LogFatalf(logging.ExitCodeFatal, "export markdown for node [%s] in tree [%s] failed: %s", node.ID, root.ID, err)
}