// ParseBanks fetch latest commit from repository and parse banks info for each country.
ParseBanks fetch latest commit from repository and parse banks info for each country.
// ParseBanks fetch latest commit from repository and parse banks info for each country .
func ParseBanks() []CountryBanks {
	log.Printf("clone repo: repoURL='%s'", repoURL)
	fs := memfs.New()
	repository, err := git.Clone(memory.NewStorage(), fs, &git.CloneOptions{ 
		URL: repoURL,
	})
	if err != nil {
		log.Fatal(err)
	}
	ref, err := repository.Head()
	if err != nil {
		log.Fatal(err)
	}
	commit, err := repository.CommitObject(ref.Hash())
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("repo cloned: lastCommitTime='%s'", commit.Committer.When.Format("02 Jan 2006 15:04:05"))
	countryBanksSlice := readBanks(fs, dbPath)
	sort.Slice(countryBanksSlice, func(i, j int) bool {
		return countryBanksSlice[i].Country < countryBanksSlice[j].Country
	})
	return countryBanksSlice
}
func ParseBanks ( ) [ ] CountryBanks { log . Printf ( " " , repoURL ) fs := memfs . New ( ) repository , err := git . Clone ( memory . NewStorage ( ) , fs , & git . CloneOptions { URL : repoURL , } ) if err != nil { log . Fatal ( err ) } ref , err := repository . Head ( ) if err != nil { log . Fatal ( err ) } commit , err := repository . CommitObject ( ref . Hash ( ) ) if err != nil { log . Fatal ( err ) } log . Printf ( " " , commit . Committer . When . Format ( " " ) ) countryBanksSlice := readBanks ( fs , dbPath ) sort . Slice ( countryBanksSlice , func ( i , j int ) bool { return countryBanksSlice [ i ] . Country < countryBanksSlice [ j ] . Country } ) return countryBanksSlice }
ParseBanks fetch latest commit from repository and parse banks info for each country.
ParseBanks fetch latest commit from repository and parse banks info for each country .
//nolint:exhaustivestruct