GoAdminGroup / go-admin

A golang framework helps gopher to build a data visualization and admin panel in ten minutes
https://www.go-admin.com
Apache License 2.0
8.16k stars 1.33k forks source link

[BUG]无法正常安装,路径错误!!! #516

Closed korykim closed 2 years ago

korykim commented 2 years ago

无法正常安装,路径错误!

go-admin tested by
    go-admin.test imports
    ./tables: "./tables" is relative, but relative import paths are not supported in module mode

版本信息:

Linux下安装记录

[root@144 go-admin]# make install
go mod tidy
go: finding module for package github.com/GoAdminGroup/go-admin/adapter/gin
go: finding module for package github.com/GoAdminGroup/go-admin/engine
go: finding module for package github.com/GoAdminGroup/go-admin/modules/db/drivers/sqlite
go: finding module for package github.com/GoAdminGroup/go-admin/template
go: finding module for package github.com/GoAdminGroup/go-admin/template/chartjs
go: finding module for package github.com/GoAdminGroup/themes/sword
go: downloading github.com/GoAdminGroup/themes v0.0.43
go: finding module for package github.com/gin-gonic/gin
go: downloading github.com/gin-gonic/gin v1.8.1
go: finding module for package github.com/GoAdminGroup/go-admin/modules/db
go: finding module for package github.com/jinzhu/gorm
go: downloading github.com/jinzhu/gorm v1.9.16
go: finding module for package github.com/GoAdminGroup/go-admin/context
go: finding module for package github.com/GoAdminGroup/go-admin/modules/config
go: finding module for package github.com/GoAdminGroup/go-admin/template/types
go: finding module for package github.com/GoAdminGroup/themes/sword/components/card
go: finding module for package github.com/GoAdminGroup/themes/sword/components/chart_legend
go: finding module for package github.com/GoAdminGroup/themes/sword/components/description
go: finding module for package github.com/GoAdminGroup/themes/sword/components/progress_group
go: finding module for package github.com/GoAdminGroup/go-admin/plugins/admin/modules/table
go: finding module for package github.com/GoAdminGroup/go-admin/tests
go: finding module for package github.com/GoAdminGroup/go-admin/tests/common
go: finding module for package github.com/GoAdminGroup/go-admin/tests/frameworks/gin
go: finding module for package github.com/GoAdminGroup/go-admin/tests/web
go: finding module for package github.com/gavv/httpexpect
go: downloading github.com/gavv/httpexpect v2.0.0+incompatible
go: found github.com/GoAdminGroup/go-admin/adapter/gin in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/engine in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/modules/db/drivers/sqlite in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template/chartjs in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/themes/sword in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.8.1
go: found github.com/GoAdminGroup/go-admin/modules/db in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/jinzhu/gorm in github.com/jinzhu/gorm v1.9.16
go: found github.com/GoAdminGroup/go-admin/context in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/modules/config in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template/types in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/themes/sword/components/card in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/chart_legend in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/description in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/progress_group in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/go-admin/plugins/admin/modules/table in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/common in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/frameworks/gin in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/web in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/gavv/httpexpect in github.com/gavv/httpexpect v2.0.0+incompatible
go: downloading github.com/jinzhu/inflection v1.0.0
go: downloading github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
go: downloading github.com/jinzhu/now v1.0.1
go: downloading github.com/magiconair/properties v1.8.1
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/stretchr/testify v1.7.1
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading google.golang.org/protobuf v1.28.0
go: downloading golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
go: downloading github.com/denisenkom/go-mssqldb v0.0.0-20200206145737-bbfc9a55622e
go: downloading gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: downloading golang.org/x/text v0.3.6
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading github.com/go-playground/validator/v10 v10.10.0
go: downloading github.com/pelletier/go-toml/v2 v2.0.1
go: downloading github.com/ugorji/go/codec v1.2.7
go: downloading github.com/goccy/go-json v0.9.7
go: downloading github.com/json-iterator/go v1.1.12
go: downloading golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069
go: downloading github.com/google/go-cmp v0.2.0
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading github.com/pkg/errors v0.8.1
go: downloading golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: downloading honnef.co/go/tools v0.0.1-2019.2.3
go: downloading github.com/kr/pretty v0.1.0
go: downloading github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
go: downloading gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a
go: downloading github.com/360EntSecGroup-Skylar/excelize v1.4.1
go: downloading github.com/go-playground/universal-translator v0.18.0
go: downloading github.com/leodido/go-urn v1.2.1
go: downloading github.com/go-playground/locales v0.14.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/onsi/ginkgo v1.7.0
go: downloading github.com/onsi/gomega v1.4.3
go: downloading golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5
go: downloading github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
go: downloading github.com/hpcloud/tail v1.0.0
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading gopkg.in/fsnotify.v1 v1.4.7
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading github.com/google/go-cmp v0.5.5
go: downloading github.com/kr/pretty v0.3.0
go: downloading github.com/go-playground/assert/v2 v2.0.1
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/rogpeppe/go-internal v1.8.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: finding module for package github.com/gobuffalo/packr/v2
go: finding module for package github.com/gobuffalo/packr/v2/file/resolver
go: downloading github.com/gobuffalo/packr v1.30.1
go: downloading github.com/gobuffalo/packr/v2 v2.8.3
go: finding module for package github.com/valyala/fasthttp
go: downloading github.com/valyala/fasthttp v1.37.0
go: finding module for package github.com/sclevine/agouti
go: downloading github.com/sclevine/agouti v3.0.0+incompatible
go: finding module for package github.com/ajg/form
go: downloading github.com/ajg/form v1.5.1
go: finding module for package github.com/fatih/structs
go: downloading github.com/fatih/structs v1.1.0
go: finding module for package github.com/google/go-querystring/query
go: downloading github.com/google/go-querystring v1.1.0
go: finding module for package github.com/gorilla/websocket
go: downloading github.com/gorilla/websocket v1.5.0
go: finding module for package github.com/imkira/go-interpol
go: downloading github.com/imkira/go-interpol v1.1.0
go: finding module for package github.com/moul/http2curl
go: downloading github.com/moul/http2curl v1.0.0
go: finding module for package github.com/xeipuuv/gojsonschema
go: downloading github.com/xeipuuv/gojsonschema v1.2.0
go: finding module for package github.com/yalp/jsonpath
go: downloading github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0
go: finding module for package github.com/yudai/gojsondiff
go: downloading github.com/yudai/gojsondiff v1.0.0
go: finding module for package github.com/yudai/gojsondiff/formatter
go: finding module for package github.com/buaazp/fasthttprouter
go: downloading github.com/buaazp/fasthttprouter v0.1.1
go: finding module for package github.com/fasthttp-contrib/websocket
go: downloading github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072
go: finding module for package github.com/valyala/fasthttp/fasthttpadaptor
go: finding module for package github.com/smartystreets/goconvey/convey
go: downloading github.com/smartystreets/goconvey v1.7.2
go: finding module for package gopkg.in/natefinch/lumberjack.v2
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: found github.com/gobuffalo/packr/v2 in github.com/gobuffalo/packr/v2 v2.8.3
go: found github.com/gobuffalo/packr/v2/file/resolver in github.com/gobuffalo/packr/v2 v2.8.3
go: found github.com/valyala/fasthttp in github.com/valyala/fasthttp v1.37.0
go: found github.com/sclevine/agouti in github.com/sclevine/agouti v3.0.0+incompatible
go: found github.com/ajg/form in github.com/ajg/form v1.5.1
go: found github.com/fatih/structs in github.com/fatih/structs v1.1.0
go: found github.com/google/go-querystring/query in github.com/google/go-querystring v1.1.0
go: found github.com/gorilla/websocket in github.com/gorilla/websocket v1.5.0
go: found github.com/imkira/go-interpol in github.com/imkira/go-interpol v1.1.0
go: found github.com/moul/http2curl in github.com/moul/http2curl v1.0.0
go: found github.com/xeipuuv/gojsonschema in github.com/xeipuuv/gojsonschema v1.2.0
go: found github.com/yalp/jsonpath in github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0
go: found github.com/yudai/gojsondiff in github.com/yudai/gojsondiff v1.0.0
go: found github.com/yudai/gojsondiff/formatter in github.com/yudai/gojsondiff v1.0.0
go: found github.com/buaazp/fasthttprouter in github.com/buaazp/fasthttprouter v0.1.1
go: found github.com/fasthttp-contrib/websocket in github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072
go: found github.com/valyala/fasthttp/fasthttpadaptor in github.com/valyala/fasthttp v1.37.0
go: found github.com/smartystreets/goconvey/convey in github.com/smartystreets/goconvey v1.7.2
go: found gopkg.in/natefinch/lumberjack.v2 in gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/magiconair/properties v1.8.5
go: downloading gopkg.in/ini.v1 v1.62.0
go: downloading golang.org/x/net v0.0.0-20220225172249-27dd8689420f
go: downloading golang.org/x/crypto v0.0.0-20220214200702-86341886e292
go: downloading go.uber.org/zap v1.17.0
go: downloading golang.org/x/text v0.3.7
go: downloading github.com/gobuffalo/packd v1.0.1
go: downloading github.com/markbates/oncer v1.0.0
go: downloading github.com/markbates/safe v1.0.1
go: downloading golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9
go: downloading github.com/andybalholm/brotli v1.0.4
go: downloading github.com/klauspost/compress v1.15.0
go: downloading github.com/valyala/bytebufferpool v1.0.0
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: downloading go.uber.org/atomic v1.7.0
go: downloading go.uber.org/multierr v1.6.0
go: downloading github.com/jtolds/gls v4.20.0+incompatible
go: downloading github.com/smartystreets/assertions v1.2.0
go: downloading github.com/karrick/godirwalk v1.16.1
go: downloading github.com/markbates/errx v1.1.0
go: downloading github.com/gobuffalo/logger v1.0.6
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f
go: downloading github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: finding module for package github.com/yudai/golcs
go: finding module for package github.com/sergi/go-diff/diffmatchpatch
go: downloading github.com/sergi/go-diff v1.2.0
go: downloading github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82
go: finding module for package github.com/yudai/pp
go: downloading github.com/yudai/pp v2.0.1+incompatible
go: found github.com/sergi/go-diff/diffmatchpatch in github.com/sergi/go-diff v1.2.0
go: found github.com/yudai/golcs in github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82
go: found github.com/yudai/pp in github.com/yudai/pp v2.0.1+incompatible
go-admin tested by
    go-admin.test imports
    ./tables: "./tables" is relative, but relative import paths are not supported in module mode
make: *** [Makefile:14: install] Error 1

Win10下错误记录

I:\Go_workspace\src\go-admin>go mod tidy
go: finding module for package github.com/GoAdminGroup/go-admin/engine
go: finding module for package github.com/GoAdminGroup/go-admin/adapter/gin
go: finding module for package github.com/GoAdminGroup/go-admin/template
go: finding module for package github.com/GoAdminGroup/go-admin/modules/db/drivers/mysql
go: finding module for package github.com/GoAdminGroup/go-admin/template/chartjs
go: finding module for package github.com/GoAdminGroup/themes/sword
go: finding module for package github.com/gin-gonic/gin
go: finding module for package github.com/GoAdminGroup/go-admin/context
go: finding module for package github.com/GoAdminGroup/go-admin/modules/config
go: finding module for package github.com/GoAdminGroup/go-admin/template/types
go: finding module for package github.com/GoAdminGroup/themes/sword/components/card
go: finding module for package github.com/GoAdminGroup/themes/sword/components/chart_legend
go: finding module for package github.com/GoAdminGroup/themes/sword/components/description
go: finding module for package github.com/GoAdminGroup/themes/sword/components/progress_group
go: finding module for package github.com/GoAdminGroup/go-admin/plugins/admin/modules/table
go: finding module for package github.com/GoAdminGroup/go-admin/tests
go: finding module for package github.com/GoAdminGroup/go-admin/tests/common
go: finding module for package github.com/GoAdminGroup/go-admin/tests/frameworks/gin
go: finding module for package github.com/GoAdminGroup/go-admin/tests/web
go: finding module for package github.com/gavv/httpexpect
go: found github.com/GoAdminGroup/go-admin/adapter/gin in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/engine in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/modules/db/drivers/mysql in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template/chartjs in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/themes/sword in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.8.1
go: found github.com/GoAdminGroup/go-admin/context in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/modules/config in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/template/types in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/themes/sword/components/card in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/chart_legend in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/description in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/themes/sword/components/progress_group in github.com/GoAdminGroup/themes v0.0.43
go: found github.com/GoAdminGroup/go-admin/plugins/admin/modules/table in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/common in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/frameworks/gin in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/GoAdminGroup/go-admin/tests/web in github.com/GoAdminGroup/go-admin v1.2.23
go: found github.com/gavv/httpexpect in github.com/gavv/httpexpect v2.0.0+incompatible
go: finding module for package github.com/gobuffalo/packr/v2
go: finding module for package github.com/gobuffalo/packr/v2/file/resolver
go: finding module for package github.com/valyala/fasthttp
go: finding module for package github.com/sclevine/agouti
go: finding module for package github.com/ajg/form
go: finding module for package github.com/fatih/structs
go: finding module for package github.com/google/go-querystring/query
go: finding module for package github.com/gorilla/websocket
go: finding module for package github.com/imkira/go-interpol
go: finding module for package github.com/moul/http2curl
go: finding module for package github.com/xeipuuv/gojsonschema
go: finding module for package github.com/yalp/jsonpath
go: finding module for package github.com/yudai/gojsondiff
go: finding module for package github.com/yudai/gojsondiff/formatter
go: finding module for package github.com/buaazp/fasthttprouter
go: finding module for package github.com/fasthttp-contrib/websocket
go: finding module for package github.com/smartystreets/goconvey/convey
go: finding module for package github.com/valyala/fasthttp/fasthttpadaptor
go: finding module for package gopkg.in/natefinch/lumberjack.v2
go: found github.com/gobuffalo/packr/v2 in github.com/gobuffalo/packr/v2 v2.8.3
go: found github.com/gobuffalo/packr/v2/file/resolver in github.com/gobuffalo/packr/v2 v2.8.3
go: found github.com/valyala/fasthttp in github.com/valyala/fasthttp v1.37.0
go: found github.com/sclevine/agouti in github.com/sclevine/agouti v3.0.0+incompatible
go: found github.com/ajg/form in github.com/ajg/form v1.5.1
go: found github.com/fatih/structs in github.com/fatih/structs v1.1.0
go: found github.com/google/go-querystring/query in github.com/google/go-querystring v1.1.0
go: found github.com/gorilla/websocket in github.com/gorilla/websocket v1.5.0
go: found github.com/imkira/go-interpol in github.com/imkira/go-interpol v1.1.0
go: found github.com/moul/http2curl in github.com/moul/http2curl v1.0.0
go: found github.com/xeipuuv/gojsonschema in github.com/xeipuuv/gojsonschema v1.2.0
go: found github.com/yalp/jsonpath in github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0
go: found github.com/yudai/gojsondiff in github.com/yudai/gojsondiff v1.0.0
go: found github.com/yudai/gojsondiff/formatter in github.com/yudai/gojsondiff v1.0.0
go: found github.com/buaazp/fasthttprouter in github.com/buaazp/fasthttprouter v0.1.1
go: found github.com/fasthttp-contrib/websocket in github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072
go: found github.com/valyala/fasthttp/fasthttpadaptor in github.com/valyala/fasthttp v1.37.0
go: found github.com/smartystreets/goconvey/convey in github.com/smartystreets/goconvey v1.7.2
go: found gopkg.in/natefinch/lumberjack.v2 in gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: finding module for package github.com/yudai/pp
go: finding module for package github.com/sergi/go-diff/diffmatchpatch
go: finding module for package github.com/yudai/golcs
go: found github.com/sergi/go-diff/diffmatchpatch in github.com/sergi/go-diff v1.2.0
go: found github.com/yudai/golcs in github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82
go: found github.com/yudai/pp in github.com/yudai/pp v2.0.1+incompatible
go-admin tested by
        go-admin.test imports
        ./tables: "./tables" is relative, but relative import paths are not supported in module mode
yunlyz commented 2 years ago

在module模式下引入相对路径是不允许的。在main_test.go文件中使用了import "./tables",修改成 import “{{module_name}}/tables”即可。

或者偷懒直接删除main_test.go不做测试也是OK了的。

推荐修改成 import “{{module_name}}/tables”。

chenhg5 commented 2 years ago

http://doc.go-admin.cn/zh/install/