code: func tagFilter(tags []string, nodes structs.CheckServiceNodes) structs.CheckServiceNodes {
  	// Build up lists of required and disallowed tags.
  	must, not := make([]string, 0), make([]string, 0)
  	for _, tag := range tags {
  		tag = strings.ToLower(tag)
  		if strings.HasPrefix(tag, "!") {
  			tag = tag[1:]
  			not = append(not, tag)
  		} else {
  			must = append(must, tag)
  		}
  	}
  
  	n := len(nodes)
  	for i := 0; i < n; i++ {
  		node := nodes[i]
  
  		// Index the tags so lookups this way are cheaper.
  		index := make(map[string]struct{})
  		if node.Service != nil {
  			for _, tag := range node.Service.Tags {
  				tag = strings.ToLower(tag)
  				index[tag] = struct{}{}
  			}
  		}
  
  		// Bail if any of the required tags are missing.
  		for _, tag := range must {
  			if _, ok := index[tag]; !ok {
  				goto DELETE
  			}
  		}
  
  		// Bail if any of the disallowed tags are present.
  		for _, tag := range not {
  			if _, ok := index[tag]; ok {
  				goto DELETE
  			}
  		}
  
  		// At this point, the service is ok to leave in the list.
  		continue
  
  	DELETE:
  		nodes[i], nodes[n-1] = nodes[n-1], structs.CheckServiceNode{}
  		n--
  		i--
  	}
  	return nodes[:n]
  }
docs: // tagFilter returns a list of nodes who satisfy the given tags. Nodes must have
  // ALL the given tags, and NONE of the forbidden tags (prefixed with !). Note
  // for performance this modifies the original slice.