Skip to content

Return struct instead of separate values #218

@digitalghost-dev

Description

@digitalghost-dev

The SetupPokemonFlagSet() and SetupAbilityFlagSet() commands return several separate values. Readability can be improved by using a struct:

type PokemonFlags struct {
    FlagSet        *flag.FlagSet
    Abilities      *bool
    ShortAbilities *bool
    Defense        *bool
    ShortDefense   *bool
    Image          *string
    ShortImage     *string
    Move           *bool
    ShortMove      *bool
    Stats          *bool
    ShortStats     *bool
    Types          *bool
    ShortTypes     *bool
}

and

type AbilityFlags struct {
	FlagSet      *flag.FlagSet
	Pokemon      *bool
	ShortPokemon *bool
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRefactoring existing code.

    Projects

    Status

    Completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions