Skip to content

Commit c64c2fc

Browse files
committed
extract result type
1 parent 788cdfe commit c64c2fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

datamuse.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ type Datamuse struct {
1212
apiURL *url.URL
1313
}
1414

15-
// Results represent a list of Datamuse's results.
16-
type Results []struct {
15+
// Results represent a single Datamuse results.
16+
type Result struct {
1717
Word string `json:"word"`
1818
Score int `json:"score"`
1919
SyllablesCount uint `json:"numSyllables,omitempty"`
2020
Tags []string `json:"tags,omitempty"`
2121
}
2222

23+
// Results represent a list of Datamuse results.
24+
type Results []Result
25+
2326
// New create a new Datamuse instance.
2427
func New() *Datamuse {
2528
u, _ := url.Parse("https://api.datamuse.com")

0 commit comments

Comments
 (0)