Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support for custom key map #16

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

xesina
Copy link
Contributor

@xesina xesina commented Jan 12, 2023

With a custom key map, we get a panic.

package main

import "github.com/go-faker/faker/v4"

func main()  {
	type CustomString string
	type CustomStruct struct {
		Map map[CustomString]string
	}

	faker.FakeData(&CustomStruct{})
}

This PR will fix this issue by converting the reflected map key.

@xesina xesina force-pushed the support-custom-key-map branch from 00463e0 to eb8370e Compare January 12, 2023 15:23
@codecov-commenter
Copy link

Codecov Report

Base: 88.99% // Head: 88.99% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (eb8370e) compared to base (12df95a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #16   +/-   ##
=======================================
  Coverage   88.99%   88.99%           
=======================================
  Files          12       12           
  Lines        1735     1736    +1     
=======================================
+ Hits         1544     1545    +1     
  Misses        137      137           
  Partials       54       54           
Impacted Files Coverage Δ
faker.go 85.87% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bxcodec bxcodec changed the title add support for custom key map fix: support for custom key map Jan 17, 2023
@bxcodec bxcodec merged commit 21cea9c into go-faker:main Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants