code: func (s *Serf) encodeTags(tags map[string]string) []byte {
  	// Support role-only backwards compatibility
  	if s.ProtocolVersion() < 3 {
  		role := tags["role"]
  		return []byte(role)
  	}
  
  	// Use a magic byte prefix and msgpack encode the tags
  	var buf bytes.Buffer
  	buf.WriteByte(tagMagicByte)
  	enc := codec.NewEncoder(&buf, &codec.MsgpackHandle{})
  	if err := enc.Encode(tags); err != nil {
  		panic(fmt.Sprintf("Failed to encode tags: %v", err))
  	}
  	return buf.Bytes()
  }
docs: // encodeTags is used to encode a tag map