Go:パッケージを提供する必要なモジュールはありません…それを追加するには:…
Go コンパイル エラーを記録する
プロジェクトアドレス:
https://github.com/apache/servicecomb-service-center
ソースコードの変更:
プロジェクトのルート ディレクトリのフロントエンドの名前をfrontend-srcに変更します。
コンパイルエラー:
$ go build -o frontend
server.go:25:2: no required module provides package github.com/apache/servicecomb-service-center/frontend/schema; to add it:
go get github.com/apache/servicecomb-service-center/frontend/schema
エラー メッセージに従って問題の解決を試みてください。
EB@DESKTOP-K45IA6V MINGW64 /d/workspace/sme/trunk/servicecomb/servicecomb-service-center-1.3.0/frontend-src
$ go get github.com/apache/servicecomb-service-center/frontend/schema
go get: module github.com/apache/servicecomb-service-center/frontend/schema: reading https://goproxy.io/github.com/apache/servicecomb-service-ce
nter/frontend/schema/@v/list: 404 Not Found
server response: not found: github.com/apache/servicecomb-service-center/frontend/schema@latest: no matching versions for query "latest"
まだエラーが発生します。(実際にはそのようなモジュールがないため)
解決:
突然、frontend の名前をfrontend-src に変更したが、ソース コードのインポート パスを変更していなかったことを思い出しました。
プロジェクトの内部ディレクトリを変更する場合 (パッケージ名と場所の変更)、プロジェクト内のこのパッケージに依存するファイル内のこのパッケージのインポート パスも変更する必要があります。
名前を変更する
「github.com/apache/servicecomb-service-center/frontend/schema」をインポートします
に
「github.com/apache/servicecomb-service-center/frontend-src/schema」をインポートします