https://github.com/baorv/phonecode
Lookup calling code written in Go
https://github.com/baorv/phonecode
calling-codes go lookup
Last synced: 9 months ago
JSON representation
Lookup calling code written in Go
- Host: GitHub
- URL: https://github.com/baorv/phonecode
- Owner: baorv
- License: mit
- Created: 2018-11-26T03:50:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-26T03:51:19.000Z (over 7 years ago)
- Last Synced: 2025-04-04T00:29:05.040Z (about 1 year ago)
- Topics: calling-codes, go, lookup
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phone code reader for
[](https://travis-ci.org/baorv/phonecode)
This library helps to lookup calling code of all countries in the world
## Installation
* Go get way
```bash
go get github.com/baorv/phonecode
```
* [Glide](https://github.com/Masterminds/glide) way
```bash
glide get github.com/baorv/phonecode
```
## Usage
```go
package main
import (
"github.com/baorv/phonecode"
"log"
)
func main() {
// You can use custom data
// reader, err := phonecode.New("/path/to/customize.csv")
reader, err := phonecode.New()
if err != nil {
log.Panicf("Error when open reader with message: %s", err.Error())
}
record := reader.LookupPhoneCode("VN")
log.Printf("%s as calling code is: %s", record.CountryCode, record.Code)
}
```
## Testing
Execute test suite:
```bash
go test
```
## Contributing
Contributions welcome! Please fork the repository and open a pull request with your changes.
## License
This project is licensed under the [MIT License](LICENSE).