mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
♻️ Refactor Go to err != nil, err == nil (#12385)
This commit is contained in:
parent
473a159ef2
commit
b100721fee
147 changed files with 1661 additions and 1659 deletions
|
|
@ -44,7 +44,7 @@ func Templates() (templates []*Template) {
|
|||
}
|
||||
|
||||
stageIndex, err := getStageIndex("templates")
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
bazaarIndex := getBazaarIndex()
|
||||
|
|
@ -131,7 +131,7 @@ func InstalledTemplates() (ret []*Template) {
|
|||
}
|
||||
|
||||
templateDirs, err := os.ReadDir(templatesPath)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
logging.LogWarnf("read templates folder failed: %s", err)
|
||||
return
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ func InstalledTemplates() (ret []*Template) {
|
|||
func InstallTemplate(repoURL, repoHash, installPath string, systemID string) error {
|
||||
repoURLHash := repoURL + "@" + repoHash
|
||||
data, err := downloadPackage(repoURLHash, true, systemID)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return installPackage(data, installPath, repoURLHash)
|
||||
|
|
@ -206,7 +206,7 @@ func filterLegacyTemplates(templates []*Template) (ret []*Template) {
|
|||
if "" != theme.Updated {
|
||||
updated := theme.Updated[:len("2006-01-02T15:04:05")]
|
||||
t, err := time.Parse("2006-01-02T15:04:05", updated)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
logging.LogErrorf("convert update time [%s] failed: %s", updated, err)
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue