| 1 | package configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/ |
| 2 | |
| 3 | // mapFetcher provides an implementation of the Fetcher interface by wrapping |
| 4 | // the `map[string]string` type. |
| 5 | type mapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher# map[string][]string |
| 6 | |
| 7 | func UniqMapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/UniqMapFetcher().(m map[string]string) Fetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Fetcher# { |
| 8 | multi := make(map[string][]string, len(m)) |
| 9 | for k, v := range m { |
| 10 | multi[k] = []string{v} |
| 11 | } |
| 12 | |
| 13 | return MapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/MapFetcher().(multi) |
| 14 | } |
| 15 | |
| 16 | func MapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/MapFetcher().(m map[string][]string) Fetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Fetcher# { |
| 17 | return mapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#(m) |
| 18 | } |
| 19 | |
| 20 | // Get implements the func `Fetcher.Get`. |
| 21 | func (m mapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#) Getscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#Get().(key string) (val string, ok bool) { |
| 22 | all := m.GetAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#GetAll().(key) |
| 23 | |
| 24 | if len(all) == 0 { |
| 25 | return "", false |
| 26 | } |
| 27 | return all[len(all)-1], true |
| 28 | } |
| 29 | |
| 30 | // Get implements the func `Fetcher.GetAll`. |
| 31 | func (m mapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#) GetAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#GetAll().(key string) []string { |
| 32 | return m[key] |
| 33 | } |
| 34 | |
| 35 | func (m mapFetcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#) Allscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/mapFetcher#All().() map[string][]string { |
| 36 | newmap := make(map[string][]string) |
| 37 | for key, values := range m { |
| 38 | for _, value := range values { |
| 39 | newmap[key] = append(newmap[key], value) |
| 40 | } |
| 41 | } |
| 42 | return newmap |
| 43 | } |