summaryrefslogtreecommitdiffstats
path: root/hugolib/site_sections.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-08-17 09:43:39 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-08-17 09:43:39 +0200
commit2a2e690707bcce8e3a157113356ebca572bc1be6 (patch)
treeb381d58065078576743335a141569f725e539a5d /hugolib/site_sections.go
parenta7555c54310612a746d34361a2d58f62207349bb (diff)
hugolib: Simplify Page.Eq
Diffstat (limited to 'hugolib/site_sections.go')
-rw-r--r--hugolib/site_sections.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/hugolib/site_sections.go b/hugolib/site_sections.go
index 25731e9d5..1a42f7808 100644
--- a/hugolib/site_sections.go
+++ b/hugolib/site_sections.go
@@ -112,14 +112,13 @@ func (p *Page) IsAncestor(other interface{}) (bool, error) {
// Eq returns whether the current page equals the given page.
// Note that this is more accurate than doing `{{ if eq $page $otherPage }}`
// since a Page can be embedded in another type.
-func (p *Page) Eq(other interface{}) (bool, error) {
+func (p *Page) Eq(other interface{}) bool {
pp, err := unwrapPage(other)
if err != nil {
- // Do not return an error on type mismatch.
- return false, nil
+ return false
}
- return p == pp, nil
+ return p == pp
}
func unwrapPage(in interface{}) (*Page, error) {