Skip to content

Instantly share code, notes, and snippets.

@artspb
Created May 6, 2021 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artspb/8ba368a4b4a2eaff6946ce5f89169c34 to your computer and use it in GitHub Desktop.
Save artspb/8ba368a4b4a2eaff6946ce5f89169c34 to your computer and use it in GitHub Desktop.
A way to update GOROOT and Go modules integration for a GoLand project.
#!/bin/bash
sed -i.bak '/<component name="GOROOT".*/d' ".idea/workspace.xml"
sed -i.bak '/<project.*/a\
<component name="GOROOT" url="file://$USER_HOME$/go/go1.16.3" />\
' ".idea/workspace.xml"
sed -i.bak '/<component name="VgoProject">/,+2d' ".idea/workspace.xml"
sed -i.bak '/<project.*/a\
<component name="VgoProject">\
<integration-enabled>true</integration-enabled>\
</component>\
' ".idea/workspace.xml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment