github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/p2p/gossip_topic_mappings_test.go (about) 1 package p2p 2 3 import ( 4 "reflect" 5 "testing" 6 ) 7 8 func TestMappingHasNoDuplicates(t *testing.T) { 9 m := make(map[reflect.Type]bool) 10 for _, v := range GossipTopicMappings { 11 if _, ok := m[reflect.TypeOf(v)]; ok { 12 t.Errorf("%T is duplicated in the topic mapping", v) 13 } 14 m[reflect.TypeOf(v)] = true 15 } 16 }