Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 1.02 KB

README.md

File metadata and controls

27 lines (21 loc) · 1.02 KB

Merriam Webster Golang API Wrapper

Codacy Badge Codacy Badge

Usage examples

func main() {
  c := mwgoapi.NewClient(&http.Client{}, mwgoapi.BaseURL, "YOUR_API_KEY")
	r, err := c.Get("hello")
	if err != nil {
		fmt.Printf("could not get response, err: %v\n", err)
		os.Exit(1)
	}

	var collegiateResponse []mwgoapi.Collegiate
	if err := c.UnmarshalResponse(r, &collegiateResponse); err != nil {
		fmt.Printf("could not unmarshal response, err: %v\n", err)
		os.Exit(1)
	}

  fmt.Println(collegiateResponse)
}