dominikh / go-mode.el

Emacs mode for the Go programming language
BSD 3-Clause "New" or "Revised" License
1.38k stars 211 forks source link

Fail to setq gofmt-args #365

Closed alisonjoe closed 4 years ago

alisonjoe commented 4 years ago

(setq gofmt-command "goimports") (setq gofmt-args "-local github.com")

my project need use goimports -local xxx.com, but i execute fail.

this is errmsg, pls

Calling gofmt: goimports (-srcdir GOPATH/sayhello_test.go 45 108 111 99 97 108 32 103 105 116 104 117 98 46 99 111 109 -w apply: Wrong type argument: stringp, 45

It looks like it's automatically converted to ASCII

muirdm commented 4 years ago

I think gofmt-args is a list. Can you try again with (setq gofmt-args '("-local" "github.com"))?

alisonjoe commented 4 years ago

I think gofmt-args is a list. Can you try again with (setq gofmt-args '("-local" "github.com"))?

I'm not very familiar with elisp programming. yes, The way you said it worked

thx!!!

psanford commented 4 years ago

Maybe we should tweak the docs for 'gofmt-args or maybe change its default from nil to be an empty list.