-
-
Notifications
You must be signed in to change notification settings - Fork 148
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 97.84% 97.86% +0.01%
==========================================
Files 8 8
Lines 372 375 +3
==========================================
+ Hits 364 367 +3
Misses 4 4
Partials 4 4
Continue to review full report at Codecov.
|
faker.go
Outdated
val, err := getValue(v.Field(i).Type()) | ||
if err != nil { | ||
return reflect.Value{}, err | ||
} | ||
val = val.Convert(v.Field(i).Type()) | ||
v.Field(i).Set(val) | ||
} else { | ||
case "skip": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the PR.
We forgot to add this.
IMHO, I think it's better to use dash (-
) instead of skip
like what JSON tag's do if we want to ignore some field.
type Sample struct {
ID string `json:"-"`
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. :) smaller and simpler. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @bxcodec , this is insufficient when working with generated code (with generated struct tags). Could you add a method to ignore fields instead? |
Hello. Thank you for good library. But I don't see ability to skip some fields for faking data. This PR should be fix it.