今どきわけあってGOPATHモードのプロジェクト開発をしなきゃならんので、workspace の場所を変えたい。
要するに GOPATH を /workspaces/go などと設定したら、ソースコードは /workspaces/go/src/myproject に置きたい。
devcontainer.json においては
|
|
などと書くわけです。
docker-compose.yml には
|
|
という指定をしておくと、myproject/.devcontainer/ の .. (つまり myproject) が /workspaces/go/src/myproject にマウントされるので、うまいこと行く…はずなのだけれど。
codespaces では workspaceFolder の指定は今の所できないとのこと。
the workspaceFolder property is not supported in Codespaces yet, but we are working on adding support for that in the coming weeks. Right now it always clones the repo to /home/{remoteUser}/workspace/{repoName}.
workspaceFolder setting doesn’t work
/workspaces/myproject が開かれてしまう。
ただし、マウントの設定はできているので codespaces のターミナルで code /workspaces/go/src/myproject と実行してやれば開き直せてうまくいく。
とはいえだるいのでこれでは使えんな。
あと codespaces はほっとくとコネクション切れるのでやっぱりどっかリモートのdocker使ったほうがまだいいかもしれない。