-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.html
115 lines (106 loc) · 5.23 KB
/
setup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en">
<head>
<title>CS-240 Assignment Setup</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
</script>
</head>
<body>
<h1>CS-240 Assignment Setup</h1>
<div id="topnavbar">
<ul class="topnavlist">
<li><a href="index.html">CS-240 Home</a></li>
<li><a href="syllabus.html">Syllabus</a></li>
<li><a href="assignments.html">Assignments</a></li>
<li><a href="announcements.html">Announcements</a></li>
<li><a href="https://piazza.com/kaust.edu.sa/fall2017/cs240/home">Q & A</a></li>
</ul>
</div>
<h2>Go Installation</h2>
<p>
You will need a working Go environment for the assignments.
Your version should be at least Go 1.5.
The version that the grading scripts will use is Go 1.6.
The latest version as of the Fall 2017 semester is Go 1.8.
</p>
<h3>Manual for Various OSes</h3>
<p>
For installing Go on your own machine manually, there are instructions to install from source or with a
package installer for several operating systems at Google's Go site: <a href="https://golang.org/dl/">golang.org</a>.
</p>
<h3>Via Package Manager for OS X</h3>
<p>
Finally, for Macs many people use package management software, the two most common of which are
<a href="http://brew.sh/">Homebrew</a> and
<a href="https://guide.macports.org/">MacPorts</a>
(these links include installation instructions for the package managers themselves).
Here is a walkthrough of installing Go using each of these:
<pre>
dustpuppy:~$ brew --version
0.9.5
dustpuppy:~$ go
-bash: go: command not found
dustpuppy:~$ brew install go
==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.
######################################################################## 100.0%
==> Pouring go-1.8.3.sierra.bottle.tar.gz
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
🍺 /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB
dustpuppy:~$ go version
go version go1.8.3 darwin/amd64</pre>
NB: if <tt>brew install go</tt> attempts to install an ancient version (e.g. 1.3) you will have to do <tt>brew update</tt> first to refresh your list of packages that Homebrew knows about.
<pre>
dustpuppy:~$ port version
Version: 2.3.4
dustpuppy:~$ go
-bash: go: command not found
dustpuppy:~$ sudo port install go
Password:
Warning: The Xcode Command Line Tools don't appear to be installed; most ports will likely fail to build.
Warning: Install them by running `xcode-select --install'.
---> Computing dependencies for go
---> Dependencies to be installed: go-1.4
---> Fetching archive for go-1.4
---> Attempting to fetch go-1.4-1.4.3_0.darwin_15.x86_64.tbz2 from https://packages.macports.org/go-1.4
---> Attempting to fetch go-1.4-1.4.3_0.darwin_15.x86_64.tbz2.rmd160 from https://packages.macports.org/go-1.4
---> Installing go-1.4 @1.4.3_0
---> Activating go-1.4 @1.4.3_0
---> Cleaning go-1.4
---> Fetching archive for go
---> Attempting to fetch go-1.7_0.darwin_15.x86_64.tbz2 from https://packages.macports.org/go
---> Attempting to fetch go-1.7_0.darwin_15.x86_64.tbz2.rmd160 from https://packages.macports.org/go
---> Installing go @1.7_0
---> Activating go @1.7_0
---> Cleaning go
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.
dustpuppy:~$ go version
go version go1.7 darwin/amd64</pre>
</p>
<h2>Tools</h2>
<p>
There are many commonly used tools in the Go ecosystem. The three most useful starting out are:
<a href="https://golang.org/cmd/gofmt/">Go fmt</a> and <a href="https://golang.org/cmd/vet/">Go vet</a>, which are built-ins, and <a href="https://github.com/golang/lint">Golint</a>, which is useful to print out style mistakes.
</p>
<h2>Editors</h2>
<p>
For those of you in touch with your systems side (this <em>is</em> a Systems course, after all), there are quite a few resources for Go development in both <a href="https://github.com/dominikh/go-mode.el">emacs</a> (additional information available <a href="http://dominik.honnef.co/posts/2013/03/emacs-go-1/">here</a>) and <a href="https://github.com/fatih/vim-go">vim</a> (additional resources <a href="http://farazdagi.com/blog/2015/vim-as-golang-ide/">here</a>).
</p>
<p>
If you are a Sublime user, here are the two indispensible Sublime packages for Go development: <a href="https://github.com/DisposaBoy/GoSublime">GoSublime</a> and <a href="https://github.com/golang/sublime-build">Sublime-Build</a>. And -- learning from the ancient emacs-vi holy war -- it would be inviting trouble to offer Sublime information without likewise dispensing the must-have Atom plugin: <a href="https://atom.io/packages/go-plus">Go-Plus</a> (walkthrough and additional info <a href="https://rominirani.com/setup-go-development-environment-with-atom-editor-a87a12366fcf#.v49dtbadi">here</a>).
</p>
<hr />
<p class="lastupdated">Last updated: 2017-08-15 18:59:31</p>
</body>
</html>