In GetArticle() func removed unnecessary else {} nesting.
This commit is contained in:
parent
69493f50aa
commit
fbb4389065
@ -50,7 +50,8 @@ func GetArticleMetadata() (meta []ArticleMetadata) {
|
|||||||
func GetArticle(name string) (*article.Article, error) {
|
func GetArticle(name string) (*article.Article, error) {
|
||||||
if artcl, ok := articles[name]; ok {
|
if artcl, ok := articles[name]; ok {
|
||||||
return &artcl, nil
|
return &artcl, nil
|
||||||
} else {
|
}
|
||||||
|
|
||||||
meta, err := articlesFS.ReadFile("articles/" + name + articleMetaExtension)
|
meta, err := articlesFS.ReadFile("articles/" + name + articleMetaExtension)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -69,7 +70,6 @@ func GetArticle(name string) (*article.Article, error) {
|
|||||||
articles[name] = artcl
|
articles[name] = artcl
|
||||||
|
|
||||||
return &artcl, nil
|
return &artcl, nil
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user