code: func (p *Params) MaxCost(v int) *Params {
  	if v >= 0 {
  		p.maxCost = v
  	}
  	return p
  }
docs: // MaxCost overrides the default value of 0 (meaning unlimited) for the maximum cost.
  // The calculation of Distance() stops when the result is guaranteed to exceed
  // this maximum, returning a lower-bound rather than exact value.
  // The new value must be zero or positive.