Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    @NobbZ:matrix.org 👍️
    Xavier Thomas
    Hey does anyone ever have an issue saving Go "code" and the Go formatter in vscode is taking a long time to do a save
    Andrew Appleton
    Hello folks, I was planning to open an issue asking about semantic highlighting support for Go, and it pointed me here first. Does anyone know if this work is planned? I'd love to see an expanded set of syntax scopes available for Go!
    I'm getting the following error: /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied
    This is after having removed 1.13 and installing 1.14
    Any idea the solution? I'm thinking there is a better way than just changing the directory / file permissions...
    Pab Akihabara
    hi guys. i want to ask a question. im fairly new to golang and i am studying it. Right now i came across with something weird. i cannot understand it. When i copy elements from one slice to another with the copy function and i assign it to a variable lets say n, if i print out the value of the variable n, it shows how many elements have been copied. How is this possible?
    Zigmas Slusnys
    Greetings everyone, before creating a bug report I wanted to ask if anyone's experiencing the same or maybe know of an existing bug report where go extension just stops highlighting any code until the VSCode gets reloaded? I'm experiencing this quite often when writing code.
    Does anyone know how to configure the left panel to NOT open when selecting "run without debugging?" This is only happening with Go.
    Steven Johnson
    Anyone know how to fix this error:
    Your workspace is misconfigured: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- ./]: exit status 1: go: cannot find main module, but found .git/config in /home/steven/Development/privacy-hero/adapter-auth-lambda to create a module there, run: go mod init . Please see https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md for more information or file an issue (https://github.com/golang/go/issues/new) if you believe this is a mistake.
    Neo Liang
    Hi, i'm on MacOS 10.15.4, after upgrading to VS.Code 1.43.2, Go extension never works for go to definitions or other go to functions in my code, i tried to downgrade to earlier version of Go extension but didn't help, anyone also mets this problem?
    Cristiano Degiorgis
    Hi, I'm using vscode-go extension 0.13.1 w/ VSCode 143.2 on MacOs10.13.6. I have a git repo with multiple folder at root level each of those w/ an independent go application plus other folder w/ infrastructure matters (eg. kind setup, docs...). If I open an instance of VScode against a specific folder everything works fine but if I open a VScode instance agianst the repo root and I'm trying to work on a specific project/folder, autocompletion, navigation, error checking do not work. Is there a way/settings to have same experience I got when I work with a single folder?
    Steven Johnson
    @crixo I have a similar issue. I think the answer is no. I had just one go project in a subfolder, and i kept getting "Your workspace is misconfigured" errors and nothing worked properly.
    At least in my case, i had to move my main.go and go.mod out of the subdirectory to the root to get it working normally again.
    With multiple go subfolders i think you may have trouble.
    Cristiano Degiorgis
    @stevenj I tried also using the workspace feature: I opened the root in VScode and I added a workspace adding subfolders into the workspace. A little better then simply opening the root by itslef, but not as smooth as an instance x each subfolder
    Steven Johnson
    @crixo i messed with the workspace as well, but without joy.
    Anyone meets this problem when debug test? run test works though
    Yang Hau
    Hi I am using export to change the env var of GOROO, but the following message still show up all the time. What should I do?
    You are neither in a module nor in your GOPATH. Please see https://github.com/golang/go/wiki/Modules for information on how to set up your Go project.
    NobbZ gitter_howjmay , how do you start vscode? Also, GOROOT is where go is installed, you probably want to change GOPATH.
    Yang Hau
    Oh I am using a cloned local compiled golang source file, that is why I want to change GOROOT to the current file
    NobbZ I think the plugin can't really cope with editing gos sources itself.
    Yang Hau
    Oh got it~ Thanks !
    Hey there,
    Here is a community for golang developers.Passionate golang developers and interested people join in.We can also collect some good resources for newbies to learn go and also have some interesting discussions.
    Pab Akihabara
    i run a script on linux which includes some go code and i get an error stating that it fails to normalise the path because it cant find go in $path. the command that fails is GO111MODULE = go mod vendor
    • =on ....
    Rajeshkumar Reddy
    I have installed a fresh installation of Go 1.11.5, VSCode on Windows WSL. One of the plugin is not installing and showing some weird error
    go.toolsGopath setting is not set. Using GOPATH /home/rajesred/gows
    Installing 1 tool at /home/rajesred/gows/bin in module mode.
    Installing golang.org/x/tools/gopls FAILED
    1 tools failed to install.
    Error: Command failed: /usr/local/go/bin/go get -v golang.org/x/tools/gopls
    Fetching https://golang.org/x/tools/gopls?go-get=1
    Parsing meta tags from https://golang.org/x/tools/gopls?go-get=1 (status code 200)
    get "golang.org/x/tools/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/gopls?go-get=1
    get "golang.org/x/tools/gopls": verifying non-authoritative meta tag
    Fetching https://golang.org/x/tools?go-get=1
    Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
    # golang.org/x/tools/internal/lsp/source
    /home/rajesred/gows/pkg/mod/golang.org/x/tools@v0.0.0-20200316194252-fafb6e2e8a4a/internal/lsp/source/completion.go:637:21: file.LineStart undefined (type *token.File has no field or method LineStart)
    Rajeshkumar Reddy
    go env
    CGO_CFLAGS="-g -O2"
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build354948885=/tmp/go-build -gno-record-gcc-switches"
    Any help is highly appreciated
    Thanks in advance

    I'm running into a permissions problem that I believe originates from the vscode extension. When I'm NOT using the language server and I save my file, I get the following error:

    go build runtime/cgo: copying /Users/cogburn/Library/Caches/go-build/3d/3dd639289c0a9344f947ca3402af02519ca5404d022f983bf14dc5ee8a31be24-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied

    In the output of the Go extension, I see the issue:

    Starting building the current package at /Users/cogburn/src/goprojects/src/hellokube
    /Users/cogburn/src/goprojects/src/hellokube>Finished running tool: /usr/local/go/bin/go build -i -o /var/folders/36/t5tp3n552gj71zsh8949yb6m0000gn/T/vscode-govxb5M4/go-code-check hellokube
    go build runtime/cgo: copying /Users/cogburn/Library/Caches/go-build/3d/3dd639289c0a9344f947ca3402af02519ca5404d022f983bf14dc5ee8a31be24-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied

    go build -i will try to install every imported package. This is running into a permission issue trying to update standard library pre-built code, i.e. runtime/cgo because it's not being run with sudo. I don't think the -i parameter is required here.
    How to configure vscode to insert spaces in { [mycode] } ?
    NobbZ Push the space-bar?
    NobbZ Or what exactly do you mean?
    vscode-go autoformats the code. Now I am used to see code in this format { [mycode] } and vscode-go extension is formatting it to {[mycode]}
    I could not find a way to configure this behaviour. If you know, please suggest. @matrixbot
    NobbZ The plugin uses the go formatter, which is not configurable and quasi standard in the go community.
    NobbZ Well, not quasi... As it is part of go, it is standard
    @matrixbot is there any configurable formatter ?
    NobbZ Not that I'm aware of.
    NobbZ Also @matrixbot is a bridge account, used by thousands of people.
    Yeah just read your github profile. :thumbsup:
    vscode-go extension startup false. Can anyone help me?
    Version: 1.44.1 (system setup)
    Commit: a9f8623ec050e5f0b44cc8ce8204a1455884749f
    Date: 2020-04-11T01:48:12.622Z
    Electron: 7.1.11
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    OS: Windows_NT x64 6.1.7601
    vscode-go version is 0.13.1
    i have install additional vs code in partition d not and start hello.py for first time but whene restart pc and start app again get error GOPATH not found
    not partition c *