Comments (6)
I just reread your initial issue and if your just having issues that one struct isnt being called it sounds like it caught an issue in the previous field. Struct returns an error so you should probably look at that.
I dont think this will work ExpirationDate time.Time fake:"{year}-{month}-{day}"
that might be your issue
from gofakeit.
It all comes down to how many times a function needs to run Uint64(). If you swap the order of a function that needs to run Uint64 2 times in front of a function that only needs to run it once you will alter your values.
from gofakeit.
@brianvoe I Apologize for my ignorance on this, but, I'm not understanding the point. Where do I use a uint64
twice? I'm just trying to realize how to use it in the right way.
from gofakeit.
It's ok took me a sec to wrap my head around it. Take a look at an example rand source below
type Dumb struct {
state uint64
}
// NewDumb initializes a Dumb source
func NewDumb(seed uint64) *Dumb {
d := &Dumb{}
d.Seed(seed)
return d
}
func (d *Dumb) Seed(seed uint64) {
d.state = seed
}
// Uint64 returns the next number in the sequence, incrementing the state.
func (d *Dumb) Uint64() uint64 {
d.state += 1
return d.state
}
So every time Uint64 is run it generates a new number.
In Gofakeit some functions may need to run Uint64() multiple times. Thus if you swap fields around, then you get an alternative output cause your previous function was given a different value then the order it was in before.
from gofakeit.
I just reread your initial issue and if your just having issues that one struct isnt being called it sounds like it caught an issue in the previous field. Struct returns an error so you should probably look at that.
I dont think this will work ExpirationDate time.Time
fake:"{year}-{month}-{day}"
that might be your issue
You're right, I was specifying that tag in a wrong way. Fixing it worked!
Thank you so much.
from gofakeit.
No problem.
from gofakeit.
Related Issues (20)
- nil values HOT 8
- Adding other delimiters for the CSVOptions HOT 2
- randomint is missing in function lookup HOT 3
- How to Sample strings based on file HOT 1
- time.Time pointers in structs yield zero values or nil
- Test Issue
- Returning errors from gofakeit.Fakeable HOT 7
- package github.com/brianvoe/gofakeit/v6: cannot find package "github.com/brianvoe/gofakeit/v6" in any of: HOT 1
- Improve data HOT 1
- Better Descriptions HOT 6
- gofakeit.date() generate different date when using same seed. HOT 4
- Generate some data with custom template function HOT 3
- Avoid circular dependencies without changing struct definition (for generated proto types)? HOT 1
- wrong game dice example
- Date Parsing Error with Single-Digit Months in CreatedFormat Field HOT 1
- Invalid tag causes infinte loop HOT 2
- UUID generates the same values over and over again. HOT 4
- Stackoverflow on cyclicly linked structures HOT 1
- How to generate fake data from specific country/language? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gofakeit.