Define structs

This commit is contained in:
Huy-Ngo 2020-10-28 21:22:03 +07:00
parent c300302227
commit 203f415c31
1 changed files with 10 additions and 0 deletions

10
main.go
View File

@ -9,6 +9,16 @@ import (
"os"
)
type Entry struct {
PartOfSpeech string `json:"partOfSpeech"`
Language string `json::"language"`
Definitions []Definition `json:"definitions"`
}
type Definition struct {
Def string `json:"definition"`
examples []string `json:"examples"`
}
func main() {
response, err := http.Get("https://en.wiktionary.org/api/rest_v1/page/definition/général")