code: func recv(bc beacon.Interface) {
  	seen := make(map[string]bool)
  	for {
  		data, src := bc.Recv()
  		if m := binary.BigEndian.Uint32(data); m != discover.Magic {
  			log.Printf("Incorrect magic %x in announcement from %v", m, src)
  			continue
  		}
  
  		var ann discover.Announce
  		ann.Unmarshal(data[4:])
  
  		if ann.ID == myID {
  			// This is one of our own fake packets, don't print it.
  			continue
  		}
  
  		// Print announcement details for the first packet from a given
  		// device ID and source address, or if -all was given.
  		key := ann.ID.String() + src.String()
  		if all || !seen[key] {
  			log.Printf("Announcement from %v\n", src)
  			log.Printf(" %v at %s\n", ann.ID, strings.Join(ann.Addresses, ", "))
  			seen[key] = true
  		}
  	}
  }
docs: // receives and prints discovery announcements