mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
Merge branch 'main' into ordered-libopenapi
This commit is contained in:
@@ -68,6 +68,9 @@ func (mg *MockGenerator) SetPretty() {
|
||||
// The name parameter is optional, if provided, the mock generator will attempt to find an example with the given name.
|
||||
// If no name is provided, the first example will be used.
|
||||
func (mg *MockGenerator) GenerateMock(mock any, name string) ([]byte, error) {
|
||||
if mock == nil || !reflect.ValueOf(mock).IsValid() || reflect.ValueOf(mock).IsNil() {
|
||||
return nil, nil
|
||||
}
|
||||
v := reflect.ValueOf(mock).Elem()
|
||||
num := v.NumField()
|
||||
fieldCount := 0
|
||||
|
||||
Reference in New Issue
Block a user