Skip to content

panic during tags processing #6

@AlexeyRyabichev

Description

@AlexeyRyabichev

At the Process method iteration is done over the fields slice, but tags variable is being assigned to the tagsGroup slice element with an index which can be out of range. This happens in the case when the tags contain a typo.

For example, this code would fail with panic:

package config

type Config struct {
	Host string `envconfig:"HOST" required:"true"`
	Port string `envconfig:"PORT" required:"true`
}
panic: runtime error: index out of range [1] with length 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions