Append appends a scheme data to schemes only if it doesn't exist.
(d *SchemeData)
| 704 | |
| 705 | // Append appends a scheme data to schemes only if it doesn't exist. |
| 706 | func (s SchemesData) Append(d *SchemeData) SchemesData { |
| 707 | found := false |
| 708 | for _, se := range s { |
| 709 | if se.SchemeName == d.SchemeName { |
| 710 | found = true |
| 711 | break |
| 712 | } |
| 713 | } |
| 714 | if found { |
| 715 | return s |
| 716 | } |
| 717 | return append(s, d) |
| 718 | } |
| 719 | |
| 720 | // DedupeByType returns a new SchemesData slice that is deduplicated by scheme |
| 721 | // type. |
no outgoing calls
no test coverage detected