urfave/cli

`cli.UintSliceFlag` flags do not implement the `ActionableFlag` interface despite having an `Action` field

solidDoWant opened this issue · 0 comments

My urfave/cli version is

v2.26.0

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this problem? Here's the GitHub guide about searching.

Dependency Management

  • My project is using go modules.

Describe the bug

Action functions do not get called on cli.UintSliceFlag flags when set. This is because it does not have a RunAction(*Context) error function as required by the ActionableFlag interface

To reproduce

Write a simple program that uses the flag as shown below:

&cli.UintSliceFlag{
    Action: func(ctx *cli.Context, nodeNumbers []uint) error {
        fmt.Println("I am not called")
        return nil
    }
}

Want to fix this yourself?

Depends on effort required

Run go version and paste its output here

go version go1.21.0 linux/amd64

Run go env and paste its output here

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/vscode/.cache/go-build'
GOENV='/home/vscode/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/workspaces/nodectl/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1492974871=/tmp/go-build -gno-record-gcc-switches'