Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Identifier's methods signature #86

Open
dilitvinov opened this issue Jan 23, 2020 · 1 comment
Open

Identifier's methods signature #86

dilitvinov opened this issue Jan 23, 2020 · 1 comment

Comments

@dilitvinov
Copy link

dilitvinov commented Jan 23, 2020

Greetings

Tell me please, why methods of Identifier interface accept reflect.Value? There is no places where it is used how I can see.

https://github.com/bxcodec/faker/blob/master/uuid.go#L24

@bxcodec
Copy link
Owner

bxcodec commented Jun 4, 2020

You can search that keyword in Github, to see where it used.

  • faker/uuid.go

    Lines 10 to 21 in 627121e

    var identifier Identifier
    // GetIdentifier returns a new Identifier
    func GetIdentifier() Identifier {
    mu.Lock()
    defer mu.Unlock()
    if identifier == nil {
    identifier = &UUID{}
    }
    return identifier
    }
  • faker/faker.go

    Lines 205 to 206 in 627121e

    ID: GetIdentifier().Digit,
    HyphenatedID: GetIdentifier().Hyphenated,

This is legacy codes, I think it's since 2017 if you have a better approach, feel free to discuss it here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants