Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [golang]

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

0
votes
0answers
21 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 ./......
0
votes
1answer
17 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
35 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
55 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
305 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
494 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
132 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
371 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
157 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
2k 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
120 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
580 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
338 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-...
5
votes
0answers
740 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
174 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
518 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. ...