-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample_test.go
More file actions
26 lines (20 loc) · 865 Bytes
/
example_test.go
File metadata and controls
26 lines (20 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package banksdb_test
import (
"fmt"
"github.com/khasanovbi/banksdb/v2"
)
func ExampleFindBank() {
creditCard := "5275940000000000"
bank := banksdb.FindBank(creditCard)
fmt.Printf("Bank info: %#v\n", bank)
// output:
// Bank info: &banksdb.Bank{Name:"citibank", Country:"ru", LocalTitle:"Ситибанк", EngTitle:"Citibank", URL:"https://www.citibank.ru/", Color:"#0088cf", Prefixes:[]int{419349, 427760, 427761, 520306, 527594}}
}
func ExampleBanksDB_FindBank() { //nolint:nosnakecase
// Create BanksDB only for Canadian and USA banks.
db := banksdb.NewBanksDB(banksdb.CA, banksdb.US)
bank := db.FindBank("5290994338557863")
fmt.Printf("Bank info: %#v\n", bank)
// output:
// Bank info: &banksdb.Bank{Name:"ally", Country:"us", LocalTitle:"Ally", EngTitle:"Ally", URL:"https://www.ally.com", Color:"#650360", Prefixes:[]int{529099, 557552}}
}