Questions tagged [golang]

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Flycheck: Suspicious state from syntax checker go-vet

When I import native package into native test file. package tests import ( ... "github.com/myGithubProjectRootPath/internal/platform/web" ) ... It report a import package path not allowed ...
0
votes
0answers
43 views

How to debug multiple flycheck checkers?

My flycheck checkers don't get along well. To simplify things I've reduced the flycheck-checkers list to only go-build golangci-lint But even now behavior is weird: syntax errors only show up ...
0
votes
0answers
19 views

How to temporaraly turn on a minor eldoc mode

I am trying to use go-eldoc, but its performance is too poor to always have on. This is what I currently have: (use-package go-eldoc :defer 2 :hook (go-mode . go-eldoc-setup)) (use-package go-...
0
votes
0answers
51 views

Performance issues using go-eldoc

The Problem Performance issues when point is inside/on a symbol go-eldoc/gocode has info for. Based on my interaction with emacs I would guess that the problem has something to do with gocode being ...
1
vote
1answer
30 views

Why in compilation-mode do my go (golang) compile errors not include the column on goto-error?

When I compile a simple (incorrect) go program like this from emacs package main func main() int { } I get this result -*- mode: compilation; default-directory: "~/Go/" -*- Compilation started at ...
0
votes
1answer
79 views

How to avoid showing gofmt fail error when saving go code every time in Emacs

Using Spacemacs and its go layer. Using Tramp in Emacs ssh to remote server to edit go file. After saving the file, it will check the syntax with gofmt . But every time it shows the error below: I ...
0
votes
1answer
64 views

Why does projectile-compile-project call “go build ./…”?

I just started to use projectile. I use it with a go project. When I call projectile-compile-project, go build ./... runs, but after that there is no binary. The same happens when I call go build ./......
1
vote
1answer
28 views

Adding speedbar support for a language major mode?

It appears to me that go-mode and speedbar are not working together - the .go files do not appear in the file list. https://github.com/dominikh/go-mode.el/issues/270 is a bug on go-mode which ...
0
votes
2answers
85 views

How to make `company-go` suggest completions from my own code?

My emacs go-lang setup is more or less the same as https://lupan.pl/dotemacs/. I get suggestions from company-go for standard library (like fmt for example), but I don't get any suggestions from my ...
1
vote
1answer
94 views

Go Lang Struct Align Text

I am using go programming I have structs like this: type person struct { firstname string lastname string age int address string } I want it to be aligned like this ...
0
votes
1answer
464 views

Set flycheck-compile command

How do I set flycheck-compile to run go-build on save? I can't find documentation on how to run flycheck-compile with go-build on save.
1
vote
2answers
901 views

Cannot set tab-width in Golang mode with Spacemacs

I set the tab-width for Golang to 2 using the following: (add-hook 'go-mode-hook (lambda () (setq-default indent-tabs-mode 1) (setq-default tab-width 2))) And when ...
1
vote
0answers
217 views

Slow typing on go mode

need a little help here, my emacs is so slow if while writing go code, it look like it is stuttering. On my observation, it happens because I have "not that" a lot folders in my src directory, most ...
4
votes
2answers
459 views

Context-aware auto completion for Go

Is there any context-aware auto-completion for Go e.g if I enter "fmt." after importing the library, auto-completion should pop up and suggest me the functions like "Println" etc.
1
vote
1answer
177 views

Imenu is missing multi-line golang function signatures

When a golang function signature is split with a linebreak it does not appear in imenu nor helm-imenu. I would like to jump between functions using helm-imenu, but this issue is in my way. Not hard-...
1
vote
1answer
3k views

Can I use emacs with company-mode and company-go to complete Go's standard library function names?

Below is my emacs init file that relates to Go. I'm trying to use company mode to auto completes Go. ;;=================================================== ; Golang related configuration ;;============...
0
votes
1answer
141 views

Extending Go function arguments show hotkey

how to add the ability to bind a hotkey to display the function's arguments? Is it even possible?
1
vote
0answers
703 views

How to add tab character while inside a rune (or string) in go-mode?

In go-mode, inside a rune hitting the tab key doesn't add the tab character. E.g.: var foobar = ` If I place the point at the start of this line and press tab it wouldn't add the tab character :( ` ...
3
votes
2answers
409 views

How to configure emacs to show documentation alongside completions while using gocode?

I have been using gocode with emacs and it gives completions of functions. Is there any way to get emacs to show the documentation of those functions in a pop up too. I am using auto-complete with go-...
6
votes
0answers
809 views

gud: highlight breakpoints with custom debugger

I use go-dlv to debug Go programs. This package is very simple and relies on standard gud functionality (https://github.com/benma/go-dlv.el/blob/master/go-dlv.el) One thing that I found missing is ...
3
votes
1answer
1k views

Automatically add golang package names that are used but not imported to import statement

Is there a way or tool in Emacs, specifically by use of go-mode, to automatically add the lines of code to the import statement, while writing code that uses those packages? Let us assume those ...
3
votes
1answer
222 views

Make ending curly brace of block go down an extra newline in Golang

Upon pressing enter inside a newly created block I would like the Emacs to move the ending curly brace an extra newline down, and then indent the cursor. Is this possible? Example Before pressing ...
1
vote
1answer
575 views

Extending autocomplete for Go to insert function arguments

Autocomplete for Go code (fantastically) suggests functions and helpfully shows the documentation for the function, e.g. arguments and return types. If I hit tab, the DialHTTP function is inserted. ...