alecthomas / alecthomas/kong-yaml

Support for `counter` value with custom type

Aberta
#10 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Go
Estrelas
16
Forks
8
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

For example:
```go

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?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.