We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
paramgen panics with index out of range if a field in an embedded struct has an invalid tag (for example, a validation tag).
paramgen
index out of range
Save the following into a file in a directory called invalid3, and run go mod init example.com/invalid3:
invalid3
go mod init example.com/invalid3
package invalid3 type Config struct { AnotherConfig Param1 string } type AnotherConfig struct { AnotherParam string `json:"anotherParam" validate:"inclusion=foo,bar"` }
Run the following tests:
// Fails with: // panic: runtime error: index out of range [0] with length 0 [recovered] func TestConfig(t *testing.T) { is := is.New(t) _, _, err := ParseParameters("./invalid3", "Config") is.NoErr(err) } // Fails with: // err: [parseStructType] error parsing field "AnotherParam": [parseField] [parseIdent] invalid tag format func TestAnotherConfig(t *testing.T) { is := is.New(t) _, _, err := ParseParameters("./invalid3", "AnotherConfig") is.NoErr(err) }
SDK version v0.7.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug description
paramgen
panics withindex out of range
if a field in an embedded struct has an invalid tag (for example, a validation tag).Steps to reproduce
Save the following into a file in a directory called
invalid3
, and rungo mod init example.com/invalid3
:Run the following tests:
Version
SDK version v0.7.2
The text was updated successfully, but these errors were encountered: