diff --git a/editions.go b/editions.go index 9fdb711..0be0815 100644 --- a/editions.go +++ b/editions.go @@ -58,9 +58,9 @@ func (b *Book) Load() { } // KeyAuthors returns array of all authors keys -func (b *Book) KeyAuthors() (keys []string, err error) { +func (b *Book) KeyAuthors() ([]string, error) { if len(b.keyAuthors) > 0 { - return b.keyAuthors, err + return b.keyAuthors, nil } for _, child := range b.S("authors").Children() { for _, v := range child.ChildrenMap() { @@ -71,7 +71,7 @@ func (b *Book) KeyAuthors() (keys []string, err error) { if len(b.keyAuthors) == 0 { return b.keyAuthors, fmt.Errorf("Could not find any authors") } - return + return b.keyAuthors, nil } //TODO: add this after dealing with authors API diff --git a/subjects_test.go b/subjects_test.go index 73f487c..6330806 100644 --- a/subjects_test.go +++ b/subjects_test.go @@ -5,6 +5,11 @@ import ( ) func TestGetSubject(t *testing.T) { + //sub, err := gol.GetSubject("computer science") + //if err != nil { + //fmt.Println(err) + //} + //fmt.Println(sub) } func TestGetSubjectDetails(t *testing.T) {