0xDkd / auxpi

🍭 集合多家 API 的新一代图床
GNU General Public License v3.0
2.72k stars 368 forks source link

cannot find package "github.com/mailru/easyjson" #1

Closed lovecn closed 6 years ago

lovecn commented 6 years ago
$ bee run auxpi
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2018/11/08 16:46:57 INFO     ▶ 0001 Using 'auxpi' as 'appname'
2018/11/08 16:46:57 INFO     ▶ 0002 Initializing watcher...
auxpiAll\all_easyjson.go:7:2: cannot find package "github.com/mailru/easyjson" i                 n any of:

先安装bee go get -u github.com/beego/bee https://beego.me/docs/intro/ go get -u github.com/mailru/easyjson 然后

$ bee run auxpi
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2018/11/08 16:52:59 INFO     ▶ 0001 Using 'auxpi' as 'appname'
2018/11/08 16:52:59 INFO     ▶ 0002 Initializing watcher...
auxpi/auxpiAll/e
github.com/astaxie/beego/cache
auxpi/auxpiAll
auxpi/bootstrap
auxpi/controllers
auxpi/server
auxpi/utils
auxpi/controllers/upload
auxpi/controllers/api
auxpi/routers
# auxpi/routers
routers\commentsRouter_______go_src_auxpi_controllers.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:25:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:34:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:43:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers_upload.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:25:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:34:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:43:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers_upload.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers_upload.go:16:13: too many errors
2018/11/08 16:53:01 ERROR    ▶ 0003 Failed to build the application: # auxpi/routers
routers\commentsRouter_______go_src_auxpi_controllers.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:25:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:34:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers.go:43:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_______go_src_auxpi_controllers_upload.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:25:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:34:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers.go:43:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers_upload.go:16:13: unknown field 'Filters' in struct literal of type beego.ControllerComments
routers\commentsRouter_controllers_upload.go:16:13: too many errors

routers文件夹下面除了router.go 全部删掉,然后执行 bee run auxpi

$ bee run auxpi
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2018/11/08 19:53:08 INFO     ▶ 0001 Using 'auxpi' as 'appname'
2018/11/08 19:53:08 INFO     ▶ 0002 Initializing watcher...
auxpi/routers
auxpi
2018/11/08 19:53:25 SUCCESS  ▶ 0003 Built Successfully!
2018/11/08 19:53:25 INFO     ▶ 0004 Restarting 'auxpi.exe'...
2018/11/08 19:53:25 SUCCESS  ▶ 0005 './auxpi.exe' is running...
2018/11/08 19:53:25.404 [I] [parser.go:96]  generate router from comments
2018/11/08 19:53:25.407 [I] [parser.go:96]  generate router from comments
2018/11/08 19:53:25.460 [I] [asm_amd64.s:1333]  http server Running on http://:2333

浏览器打开localhost:2333 编译


$ GOOS=windows GOARCH=amd64 bee pack
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2018/11/08 20:05:46 INFO     ▶ 0001 Packaging application on 'C:\Users\go\src\AUXPI'...
2018/11/08 20:05:46 INFO     ▶ 0002 Building application...
2018/11/08 20:05:46 INFO     ▶ 0003 Using: GOOS=windows GOARCH=amd64
2018/11/08 20:05:57 SUCCESS  ▶ 0004 Build Successful!
2018/11/08 20:05:57 INFO     ▶ 0005 Writing to output: C:\Users\go\src\AUXPI\AUXPI.tar.gz
2018/11/08 20:05:57 INFO     ▶ 0006 Excluding relpath prefix: .
2018/11/08 20:05:57 INFO     ▶ 0007 Excluding relpath suffix: .go:.DS_Store:.tmp
2018/11/08 20:06:00 SUCCESS  ▶ 0008 Application packed!

$ ls
auxpi.exe*    auxpiAll/     conf/           LICENSE  README.md  static/  views/
auxpi.exe~*   auxpiRun.log  controllers/    main.go  routers/   tests/
AUXPI.tar.gz  bootstrap/    lastupdate.tmp  models/  server/    utils/

$ ./auxpi.exe
2018/11/08 20:09:08.104 [I] [router.go:269]  C:\Users\go\src\AUXPI\controllers\upload no changed
2018/11/08 20:09:08.105 [I] [router.go:269]  C:\Users\go\src\AUXPI\controllers no changed
2018/11/08 20:09:08.153 [I] [asm_amd64.s:1333]  http server Running on http://:2333
0xDkd commented 6 years ago

请尝试安装 easy_json ,运行下面的命令安装 easy_json go get -u github.com/mailru/easyjson 另外建议重新 pull 代码,修复了 routers 无法加载的 bug