Repository: bxcodec/faker
Pull request #52 (2019-01-30 16:00:30)

fix: typos ("tool_free" -> "toll_free")

codecov[bot]: # [Codecov](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=h1) Report
> Merging [#52](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=desc) into [master](https://codecov.io/gh/bxcodec/faker/commit/16dcad9fa6f26f3c2a1c1fb702ab4a2c6e8bdb50?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/bxcodec/faker/pull/52/graphs/tree.svg?width=650&token=cLPGB7MHVc&height=150&src=pr)](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master      #52   +/-   ##
=======================================
  Coverage   94.62%   94.62%           
=======================================
  Files          10       10           
  Lines         540      540           
=======================================
  Hits          511      511           
  Misses         15       15           
  Partials       14       14
```


| [Impacted Files](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [faker.go](https://codecov.io/gh/bxcodec/faker/pull/52/diff?src=pr&el=tree#diff-ZmFrZXIuZ28=) | `87.5% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=footer). Last update [16dcad9...6ee8bc4](https://codecov.io/gh/bxcodec/faker/pull/52?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

bxcodec: Thank you for the PR. This is a silly thing that I missed to fix :D 
But changing this will be a breaking change. 

qjcg: Fair enough. My view is that misspellings in the public API can confuse and frustrate developers and convey a sense of lower code quality, and therefore merit a breaking change, but the choice is up to you of course 

Patch:
diff --git a/README.md b/README.md
index 826c221..e250dbf 100644
--- a/README.md
+++ b/README.md
@@ -124,7 +124,7 @@ type SomeStruct struct {
 	MacAddress         string  `faker:"mac_address"`
 	URL                string  `faker:"url"`
 	UserName           string  `faker:"username"`
-	ToolFreeNumber     string  `faker:"tool_free_number"`
+	TollFreeNumber     string  `faker:"toll_free_number"`
 	E164PhoneNumber    string  `faker:"e_164_phone_number"`
 	TitleMale          string  `faker:"title_male"`
 	TitleFemale        string  `faker:"title_female"`
@@ -178,7 +178,7 @@ func main() {
 			MacAddress: cd:65:e1:d4:76:c6
 			URL: https://www.oEuqqAY.org/QgqfOhd
 			UserName: lVxELHS
-			ToolFreeNumber: (777) 831-964572
+			TollFreeNumber: (777) 831-964572
 			E164PhoneNumber: +724891571063
 			TitleMale: Mr.
 			TitleFemale: Queen
diff --git a/faker.go b/faker.go
index 1ead7da..d4ff380 100644
--- a/faker.go
+++ b/faker.go
@@ -35,7 +35,7 @@ const (
 	CreditCardNumber   = "cc_number"
 	CreditCardType     = "cc_type"
 	PhoneNumber        = "phone_number"
-	TollFreeNumber     = "tool_free_number"
+	TollFreeNumber     = "toll_free_number"
 	E164PhoneNumber    = "e_164_phone_number"
 	TitleMale          = "title_male"
 	TitleFemale        = "title_female"


Test patch:
diff --git a/faker_test.go b/faker_test.go
index 69335d9..a41bed2 100644
--- a/faker_test.go
+++ b/faker_test.go
@@ -144,7 +144,7 @@ type TaggedStruct struct {
 	MacAddress         string  `faker:"mac_address"`
 	URL                string  `faker:"url"`
 	UserName           string  `faker:"username"`
-	ToolFreeNumber     string  `faker:"tool_free_number"`
+	TollFreeNumber     string  `faker:"toll_free_number"`
 	E164PhoneNumber    string  `faker:"e_164_phone_number"`
 	TitleMale          string  `faker:"title_male"`
 	TitleFemale        string  `faker:"title_female"`
@@ -188,7 +188,7 @@ func (t TaggedStruct) String() string {
 	MacAddress: %s,
 	URL: %s,
 	UserName: %s,
-	ToolFreeNumber: %s,
+	TollFreeNumber: %s,
 	E164PhoneNumber: %s,
 	TitleMale: %s,
 	TitleFemale: %s,
@@ -219,7 +219,7 @@ func (t TaggedStruct) String() string {
 }`, t.Latitude, t.Longitude, t.CreditCardNumber,
 		t.CreditCardType, t.Email, t.IPV4,
 		t.IPV6, t.Password, t.PhoneNumber, t.MacAddress,
-		t.URL, t.UserName, t.ToolFreeNumber,
+		t.URL, t.UserName, t.TollFreeNumber,
 		t.E164PhoneNumber, t.TitleMale, t.TitleFemale,
 		t.FirstName, t.FirstNameMale, t.FirstNameFemale, t.LastName,
 		t.Name, t.UnixTime, t.Date,