Beego flag redefined: graceful

Hi! I’ve simple mvc beego. And when I try to add my package I receive such error. For the first time I faced with this problem when I added cron (third-party functionality).
I’ve run into this problem twice and don’t understand what I’m doing wrong?
I am sure this is not code problem, maybe conflict with my $GOPATH or something any.

go env

jk@jk-MS-7B00:/usr/local/go/src$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jk/.cache/go-build"
GOENV="/home/jk/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/jk/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/usr/local/go/src/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 -fdebug-prefix-map=/tmp/go-build1501291865=/tmp/go-build -gno-record-gcc-switches"

echo $PATH

jk@jk-MS-7B00:/usr/local/go/src$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/jk/go/bin:/usr/local/go/bin

I pushed this commit with error. May be someone wants to try to run. If you will remove package models from controllers/default.go all will be ok.

git clone https://github.com/NeverhoodRUS/TFOMS.git

Hi @Neverhood ,

I get the same error when I open your project in GitPod.

graceful is a Beego flag.

The go.mod file requires Beego v1.12.12 and Beego v2.0.1 at the same time.

I would guess that this is the source of the error. Try using only one version of Beego and verify if this eliminates the error.


Update: Yep, after I changed "github.com/beego/beego" to "github.com/beego/beego/v2" in abstractDB.go (the only file that imports v1 of Beego), the error vanished. (I get follow-up errors instead, but that’s a different topic.)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.