Closed8

go1.19のflagのTextVarを試すメモ

podhmopodhmo

go1.19をインストールしておこう

$ go install golang.org/dl/go1.19@latest
$ go1.19 download
podhmopodhmo

存在する

$ go1.19 doc flag.TextVar
package flag // import "flag"

func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)
    TextVar defines a flag with a specified name, default value, and usage
    string. The argument p must be a pointer to a variable that will hold the
    value of the flag, and p must implement encoding.TextUnmarshaler. If the
    flag is used, the flag value will be passed to p's UnmarshalText method.
    The type of the default value must be the same as the type of p.
このスクラップは2023/07/03にクローズされました