Skip to content

baorv/phonecode

Repository files navigation

Phone code reader for

Build Status

This library helps to lookup calling code of all countries in the world

Installation

  • Go get way
go get github /baorv/phonecode
glide get github /baorv/phonecode

Usage

packagemain

import(
"github /baorv/phonecode"
"log"
)

funcmain() {
// You can use custom data
// reader, err:= phonecode.New( "/path/to/customize.csv" )
reader,err:=phonecode.New()
iferr!=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:

gotest

Contributing

Contributions welcome! Please fork the repository and open a pull request with your changes.

License

This project is licensed under theMIT License.

About

Lookup calling code written in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages