code: func checksWatch(params map[string]interface{}) (WatcherFunc, error) {
  	stale := false
  	if err := assignValueBool(params, "stale", &stale); err != nil {
  		return nil, err
  	}
  
  	var service, state string
  	if err := assignValue(params, "service", &service); err != nil {
  		return nil, err
  	}
  	if err := assignValue(params, "state", &state); err != nil {
  		return nil, err
  	}
  	if service != "" && state != "" {
  		return nil, fmt.Errorf("Cannot specify service and state")
  	}
  	if service == "" && state == "" {
  		state = "any"
  	}
  
  	fn := func(p *Plan) (BlockingParamVal, interface{}, error) {
  		health := p.client.Health()
  		opts := makeQueryOptionsWithContext(p, stale)
  		defer p.cancelFunc()
  		var checks []*consulapi.HealthCheck
  		var meta *consulapi.QueryMeta
  		var err error
  		if state != "" {
  			checks, meta, err = health.State(state, &opts)
  		} else {
  			checks, meta, err = health.Checks(service, &opts)
  		}
  		if err != nil {
  			return nil, nil, err
  		}
  		return WaitIndexVal(meta.LastIndex), checks, err
  	}
  	return fn, nil
  }
docs: // checksWatch is used to watch a specific checks in a given state