Commit graph

19 commits

Author SHA1 Message Date
Enze Chi 21c442050a Add go-run-args to pass command line arguments to go run
When executing the main function which requires command line arguments, user can
set `go-run-args` to pass command line arguments to compiled binary.

The example below demonstrates how to pass command line arguments by setting
`go-run-args` as file local variable:

package main

import (
	"fmt"
	"os"
	"strconv"
)

func main() {
	//Atoi converts a string to an int
	fmt.Println("Arguments:", os.Args)
	a, _ := strconv.Atoi(os.Args[1])
	b, _ := strconv.Atoi(os.Args[2])

	result := sum(a, b)
	fmt.Printf("The sum of %d and %d is %d\n", a, b, result)
}

func sum(a, b int) int {
	return a + b
}

// Local Variables:
// go-run-args: "10 5"
// End:
2019-04-05 22:59:17 +02:00
Tim Heckman e84bd90262 Set lsp-prefer-flymake to :none when Go layer is using LSP
When switching the Go layer to use the LSP backend with `golangci-lint`, I
noticed that none of my linter errors were being rendered with my source code.
Digging in further, I eventually learned it was due to `lsp-prefer-flymake`
being set to `nil` and not `:none`.

This change updates the Go layer, when using LSP and golangci-lint, to set
`lsp-prefer-flymake` to `:none`. If this is not set, the golangci-lint errors
will not be reported.

This is an alternative to #12043.

Fixes #11680

Signed-off-by: Tim Heckman <t@heckman.io>
2019-04-04 12:46:49 +02:00
Enze Chi 004d407908 Add toggle control for verbose go test output 2019-04-04 12:17:53 +02:00
Justin f8bb6997a9 Remove lsp-javascript-typescript package for lsp built in.
Remove lsp-go package for lsp built in.
Changed go/react/typescript lsp-*-enable hooks to lsp
Update go/typescript/rust layer docs for lsp-mode installation command.
Remove unused rust layer variable
2019-01-15 00:41:30 +02:00
Lupco Kotev 1d49cd7ed8 Add golangci-lint support 2018-08-20 23:03:45 +01:00
Ljupcho Kotev 107833af16 Remove unnecessary company-go function 2018-08-16 12:01:38 +01:00
Ljupcho Kotev 81865e1ea2 Change backend name from default to go-mode 2018-08-16 00:39:17 +03:00
Lupco Kotev bb3e3b2103 Add lsp support for go 2018-08-16 00:39:17 +03:00
lawr 591fe78eec go-layer: supoort set-tab-width equal nil to work with editorconfig 2018-08-10 00:36:46 +03:00
syl20bnr 0e0d5088b9 go: remove unused function load-gopath-file 2018-06-09 00:45:48 -04:00
syl20bnr 7951d763e3 go: reformat spacemacs/go-packages-gopkgs
Use setq instead of customize
Put spacemacs//go-set-tab-width in funcs.el
2018-06-09 00:43:52 -04:00
Cosmin Cojocar 938155c50a Configure the go-packages-functions to use the gopkgs tool
This is a much faster option than the current native function.
2018-06-09 00:39:08 -04:00
syl20bnr 46c5dfa4a7 cl-loop instead of loop 2018-01-06 21:38:13 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Josh Santos bfde1a44dc Convert remote file name to local name, stripping trampy stuff
Turn into conditional so local files still work
2017-08-27 22:21:31 -04:00
Eivind Fonn e4185e4c61 Some refactoring of go layer 2017-05-25 13:20:36 +02:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
syl20bnr d94b17d57b go: use :toggle for flycheck-gometalinter package
Turn the maybe function into an always since the package
flycheck-gometalinter is installed only if gometalinter is found.
2016-04-29 22:58:23 -04:00
syl20bnr 33ead6fc42 Deprecation of extensions and <pkg>-excluded-packages variables
As announced in previous releases, see CHANGELOG.next for more info
in the Breaking Changes section.
2016-01-17 22:06:04 -05:00