Complete Computing Environment: Golang

Table of Contents

Programming in Goggle Go

(provide 'cce-golang)

I am … decidedly not a fan of Google's Go language, but I need to use it to make far more money than I deserve, so I use it.

export GOPATH=~/go/
export PATH=$PATH:$GOPATH/bin
- name: golang and tools installed
  apt:
    state: installed
    name: "{{item}}"
  when: ansible_pkg_mgr == "apt"
  with_items:
  - golang-go
  - golang-1.10-doc

- name: golang and tools installed
  dnf:
    state: installed
    name: "{{item}}"
  when: ansible_pkg_mgr == "dnf"
  with_items:
  - golang-bin
  - golang-docs

- name: gocode etc installed
  shell:
    cmd: "go get {{item}}"
    creates: /home/rrix/go/bin/goflymake
  become: yes
  become_user: rrix
  with_items:
  - github.com/dougm/goflymake
  - golang.org/x/tools/cmd/goimports
  - golang.org/x/tools/cmd/...
(install-pkgs '(go-mode))

(setq gofmt-command "goimports")
(add-hook 'go-mode-hook (lambda ()
                           (add-hook 'before-save-hook 'gofmt-before-save nil t)))
(add-hook 'go-mode-hook (lambda ()
                          (set (make-local-variable 'company-backends) '(company-go))
                          (company-mode)))

Author: Ryan Rix

Created: 2018-04-11 Wed 11:53

Validate XHTML 1.0