Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] feature of go version control #1269

Open
zouyee opened this issue Feb 11, 2025 · 1 comment
Open

[Question] feature of go version control #1269

zouyee opened this issue Feb 11, 2025 · 1 comment
Assignees

Comments

@zouyee
Copy link

zouyee commented Feb 11, 2025

We manage the Golang version through .go-version file in our GitHub workflow. Can the following approach be used to make it effective for the devcontainer.json file?

"features": {
  "ghcr.io/devcontainers/features/go:1": {
    "VERSION": "${containerEnv:VERSION}"
  }
},
"containerEnv": {
  "VERSION": "1.19.2"
}
@Mathiyarasy
Copy link
Contributor

Hello , if you want to pass the value from workflow to devcontainer.json you can use localEnv

echo "GOVERSRION=1.19.2" >> $GITHUB_ENV

  "ghcr.io/devcontainers/features/go:1": {
    "VERSION": "${localEnv:GOVERSRION}"
  }

reference: https://code.visualstudio.com/remote/advancedcontainers/overview
Let us know if this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants