alecthomas / alecthomas/kong-yaml

Support for `counter` value with custom type

オープン
#10 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
16
フォーク
8
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。