I am new to emacs.I created a go file but there were no syntax highlighting,auto completion etc.
I uncommented :lang go in init.el but it didnt do anything.I tried running lang: go.There was no option of lsp in init.el .
You can simply add the go-mode package to your init.el
and you'll have the code highlight :
(use-package go-mode
:ensure t)
If you want to do things like auto-completion or refactoring, you'll need the LSP.
init.el
to use the go-mode
package required for Go support and setup a hook to enable the LSP for it :(use-package go-mode
:ensure t
:hook (go-mode . lsp-deferred))
lsp-mode
package to your init.el
:(use-package lsp-mode
:ensure t
:commands lsp)
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode)