bxcodec / faker

Go (Golang) Fake Data Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker

Home Page:https://pkg.go.dev/github.com/bxcodec/faker/v4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Identifier's methods signature

dilitvinov opened this issue · comments

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

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.