Skip to content

Support for counter value with custom type #10

@td0m

Description

@td0m

For example:

type loglvl int

type LoggerPlugin struct { 
  Config struct {
    Level loglvl `name:"log" type:"counter" short:"v" help:"Log level. Higher = more verbose." default:"0"`
  } `embed:""`
}

Results in:
panic: reflect.Set: value of type int is not assignable to type cmds.loglvl

Removing the counter type, or setting the type back to int works fine.

Is there any way we could add support for counters with custom types as shown in the above example?

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