Please answer these questions before submitting your issue. Thanks!
bee version)?go env)?```GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/theo/Library/Caches/go-build"
GOENV="/Users/theo/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/theo/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/theo/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zl/4vn0pm8x4lz1h2bm6y5kkdnm0000gn/T/go-build854159209=/tmp/go-build -gno-record-gcc-switches -fno-common"
3. What did you do?
I created a new installation of Beego using the `bee api my-api` command and then I add this code into `controllers/object.go`:
package controllers
import (
"my-app/models"
"encoding/json"
beego "github.com/astaxie/beego/server/web"
)
// Operations about object
type ObjectController struct {
beego.Controller
}
4. What did you expect to see?
I am expecting to see the messages `Built successfully` and `app is running`
5. What did you see instead?
2020/11/11 15:33:47 INFO ▶ 0002 Initializing watcher...
go: finding module for package github.com/astaxie/beego/server/web
controllers/object.go:7:2: module github.com/astaxie/beego@latest found (v1.12.3), but does not contain package github.com/astaxie/beego/server/web
2020/11/11 15:33:49 ERROR ▶ 0003 Failed to build the application: go: finding module for package github.com/astaxie/beego/server/web
controllers/object.go:7:2: module github.com/astaxie/beego@latest found (v1.12.3), but does not contain package github.com/astaxie/beego/server/web
```
Same issue here. Hope it gets fixed ASAP
beego/server/web is beego v2.0's package. Please try go get -u github.com/astaxie/beego or go get github.com/astaxie/beego@develop
beego/server/webis beego v2.0's package. Please trygo get -u github.com/astaxie/beegoorgo get github.com/astaxie/[email protected]
Tried that so many times but go get always install beego 1.12.3 which is not being detected by bee tool. Followed the step by step installation but i always end up seeing same error everytime i run bee
Could you share your commands?
Here is my command:
bee api helloapi
cd helloapi
go get -u github.com/astaxie/beego@develop
$ go get github.com/astaxie/beego
$ go get -u github.com/astaxie/beego
$ go get github.com/beego/bee
$ go get -u github.com/beego/bee
$ bee version
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
____/ ___| ___| v2.0.0
├── Beego : Beego is not installed. Please do consider installing it first: https://github.com/astaxie/beego. If you are using go mod, and you don't install the beego under $GOPATH/src/github.com/astaxie, just ignore this.
├── GoVersion : go1.15.4
├── GOOS : windows
├── GOARCH : amd64
├── NumCPU : 4
├── GOPATH : C:\Users\USERPC\go
├── GOROOT : c:\go
├── Compiler : gc
└── Date : Thursday, 12 Nov 2020
(Beego is not detected. Dont know why?! But I proceed anyway hopes miracle happens)
$ bee new mrms
2020/11/12 21:47:59 INFO ▶ 0001 generate new project support go modules.
2020/11/12 21:47:59 INFO ▶ 0002 Creating application...
create C:\Users\MIS\go\src\mrms\go.mod
create C:\Users\MIS\go\src\mrms\
create C:\Users\MIS\go\src\mrms\conf\
create C:\Users\MIS\go\src\mrms\controllers\
create C:\Users\MIS\go\src\mrms\models\
create C:\Users\MIS\go\src\mrms\routers\
create C:\Users\MIS\go\src\mrms\tests\
create C:\Users\MIS\go\src\mrms\static\
create C:\Users\MIS\go\src\mrms\static\js\
create C:\Users\MIS\go\src\mrms\static\css\
create C:\Users\MIS\go\src\mrms\static\img\
create C:\Users\MIS\go\src\mrms\views\
create C:\Users\MIS\go\src\mrms\conf\app.conf
create C:\Users\MIS\go\src\mrms\controllers\default.go
create C:\Users\MIS\go\src\mrms\views\index.tpl
create C:\Users\MIS\go\src\mrms\routers\router.go
create C:\Users\MIS\go\src\mrms\tests\default_test.go
create C:\Users\MIS\go\src\mrms\main.go
2020/11/12 21:47:59 SUCCESS ▶ 0003 New application successfully created!
$ bee run
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
____/ ___| ___| v2.0.0
2020/11/12 21:54:57 INFO ▶ 0001 Using 'mrms' as 'appname'
2020/11/12 21:54:57 INFO ▶ 0002 Initializing watcher...
go: finding module for package github.com/astaxie/beego/server/web
main.go:5:2: module github.com/astaxie/beego@latest found (v1.12.3), but does not contain package github.com/astaxie/beego/server/web
2020/11/12 21:54:58 ERROR ▶ 0003 Failed to build the application: go: finding module for package github.com/astaxie/beego/server/web
main.go:5:2: module github.com/astaxie/beego@latest found (v1.12.3), but does not contain package github.com/astaxie/beego/server/web
Been used Beego in my previous small project and i loved it. So many features compared to other golang fw. Thanks in advance for your assistance.
Here is my command:
bee api helloapi cd helloapi go get -u github.com/astaxie/beego@develop
Will try. Hope this is the answer. Thanks man
EDIT: This works!! What is the difference between bee new and bee api? Afer examining the generated project, i find api a bit confusing compared to bee new project.
@ignitum Does bee api helloapi or bee new helloapi work for you ?
The structure is different. From my understanding, bee api creates RESTful server and bee new create a general web server. In fact, I think you could use any of them.
And you are using beego 2.0.0-beta, please check https://github.com/beego/beego-example for more examples.
The structure is different. From my understanding,
bee apicreates RESTful server andbee newcreate a general web server. In fact, I think you could use any of them.And you are using beego 2.0.0-beta, please check https://github.com/beego/beego-example for more examples.
I believe that
cd helloapi
go get -u github.com/astaxie/beego@develop
works.
And if you guys don't want to try with v2.0.0,
run
go get github.com/beego/[email protected]
bee api helloapi
It works now!! Thanks man. Tried go get -u github.com/astaxie/beego@develop after bee new, run and IT WORKS!! Been wasting several days just missing @develop at the end of go get -u
The classic beego i know is, simply installing the package, then the bee tool, bee new, bee run and voila it will work.
But anyway thanks for the help. Didn't find that @develop in the docu though
It did work for me with go get github.com/beego/[email protected] but not v2.0.0 or develop.
Thanks for your continuous assistance with this one @flycash .
*This issue has been initially raised for the bee api ... command, bee new ... worked as a charm from the beginning on my end.
Does updating the package at the beginning just after installing it contributes on the issue?
$ go get github.com/astaxie/beego
$ go get -u github.com/astaxie/beego
$ go get github.com/beego/bee
$ go get -u github.com/beego/bee
No, unfortunately. @ignitum .
we have two totally different beego. v1.x and v2.x(now 2.0.0-beta released)
So when got a similar error, just check the version of bee and beego.
If you want to use v1.x
using
go get github.com/beego/[email protected]
bee xxxx
..
cd your-project
go get github.com/astaxie/[email protected]
If you want to try beego 2.0.0-beta
go get -u github.com/beego/bee // install the last commit
bee xxx
...
go get -u github.com/astaxie/beego@develop
I will keep this issue open and if someone got errors, show me the error info and the beego's version( Or beego's structure).
Tried your suggestion
$ go get github.com/beego/[email protected]
go: cannot use path@version syntax in GOPATH mode
What does this mean? Thanks!
EDITED: Tried other paths because i am assuming that i should not execute the command if i am inside the gopath folder, still no luck.
GOPATH mode.
You need to use go mod mode.
Please try
export GO111MODULE="on"
One last concern, everything works fine until i noticed that when i hover to beego.Controller, it says that field Controller invalid type and there is no suggestion everytime I access the 'c' variable inside the controller function. How to reference the beego v1.12.3 in $GOPATH/pkg/mod? I think that is the problem.
One last concern, everything works fine until i noticed that when i hover to beego.Controller, it says that
field Controller invalid typeand there is no suggestion everytime I access the 'c' variable inside the controller function. How to reference the beego v1.12.3 in $GOPATH/pkg/mod? I think that is the problem.
Sorry, I don't understand what you mean.
Could you share the code to me?