<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-6368548039472655543</id><updated>2012-02-27T08:55:48.736+01:00</updated><category term="blogging" /><category term="golang" /><title type="text">embrace change</title><subtitle type="html">the best way to predict the future is to invent it - alan kay</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://mue.tideland.biz/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://mue.tideland.biz/" /><author><name>Frank Müller</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-5TdaFo5OKSw/AAAAAAAAAAI/AAAAAAAADj0/mSKvQL6oors/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/tideland/RNCL" /><feedburner:info uri="tideland/rncl" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry><id>tag:blogger.com,1999:blog-6368548039472655543.post-2244322753981090824</id><published>2012-02-27T08:37:00.000+01:00</published><updated>2012-02-27T08:37:26.206+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="golang" /><title type="text">Go environment setup</title><content type="html">&lt;br /&gt;A good start for Go development is a root directory for all further directories like &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/home/themue/projects&lt;/span&gt;. It will be the home for the Go SDK, 3rd party packages and own projects. The current weekly will be installed with the command &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;hg clone -u weekly https://code.google.com/p/go&lt;/span&gt; in the directory &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;go&lt;/span&gt;. &lt;a href="http://weekly.golang.org/doc/install.html"&gt;http://weekly.golang.org/doc/install.html&lt;/a&gt; documents all needed steps in detail. The two other directories have to be created by hand, together with a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;src&lt;/span&gt; and a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;pkg&lt;/span&gt; subdirectory each. This way you get the structure&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/home/themue/projects&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /go&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /bin&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /test&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /own&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /pkg&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /src&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /3rdparty&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /pkd&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /src&lt;/span&gt;&lt;/blockquote&gt;Why this 3rd party directory? The new Go tools have a very intelligent way to install external packages in a different directory than own packages. It's based on the environment variable &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$GOPATH&lt;/span&gt;. The naming already shows that it's a path, not only one directory. &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$GOPATH&lt;/span&gt; is the path where commands like &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;go build&lt;/span&gt; and &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;go install&lt;/span&gt; look for referenced packages they need to compile and link the software. To do so external packages have to be installed before. The command &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;go get&lt;/span&gt; will install the sources and the compiled package into the first directory of the path. So the order in the case above should be&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GOPATH=$HOME/projects/3rdparty:$HOME/projects/own&lt;/span&gt;&lt;/blockquote&gt;When installing own packages which source is located in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.../own/src&lt;/span&gt; it will be installed into &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.../own/pkg&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Which environment variables else are needed? One is &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$GOROOT&lt;/span&gt;. It has to point to the root of the Go SDK, here &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/home/themue/projects/go&lt;/span&gt;. The compiled binaries will by default be installed in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$GOROOT/bin&lt;/span&gt;. But there are two further options for the work with the SDK:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The location for the binaries is ok. Here the standard &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$PATH&lt;/span&gt; should point to this directory too with &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PATH=$PATH:$HOME/projects/go/bin&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;The other way is that you've got a directory like &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$HOME/bin&lt;/span&gt; for all your private binaries and scripts and it's already in your &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$PATH&lt;/span&gt;. In this case you can set &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GOBIN=$HOME/bin&lt;/span&gt; before installing the Go SDK. In this case after the compilation the Go binaries get installed in your &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$HOME/bin&lt;/span&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Inside your own source directory you may need further subdirectories for your different projects. Their naming depends on possible external SCM environments you're using. Mine is &lt;a href="http://code.google.com./"&gt;code.google.com.&lt;/a&gt; So for the &lt;i&gt;Tideland Common Go Library&lt;/i&gt; (see &lt;a href="http://code.google.com/p/tcgl"&gt;http://code.google.com/p/tcgl&lt;/a&gt;) I placed the source in&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.../own/src/code.google.com/p/tcgl&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;.&amp;nbsp;&lt;/span&gt;This project contains several packages which I now can import as &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;code.google.com/p/tcgl/foo&lt;/span&gt;, regardless if I'm inside the same project or another one. And more important is that people who are taking a look into my code can easily see how to get and import it as their 3rd party code.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6368548039472655543-2244322753981090824?l=mue.tideland.biz' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/tideland/RNCL/~4/JSzkEBQl8iI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mue.tideland.biz/feeds/2244322753981090824/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://mue.tideland.biz/2012/02/go-environment-setup.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2244322753981090824" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2244322753981090824" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/tideland/RNCL/~3/JSzkEBQl8iI/go-environment-setup.html" title="Go environment setup" /><author><name>Frank Müller</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-5TdaFo5OKSw/AAAAAAAAAAI/AAAAAAAADj0/mSKvQL6oors/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mue.tideland.biz/2012/02/go-environment-setup.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6368548039472655543.post-1862502399071774359</id><published>2012-02-26T20:39:00.001+01:00</published><updated>2012-02-26T20:41:58.914+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogging" /><title type="text">Restart of this blog</title><content type="html">So, re-started this blog. It is now hosted at &lt;i&gt;blogger.com&lt;/i&gt; and focussed on software development. Privat topics are handled at &lt;a href="http://frank.mweb.de/"&gt;frank.mweb.de&lt;/a&gt;. But that blog is in German. The first topics are in the pipe, so stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6368548039472655543-1862502399071774359?l=mue.tideland.biz' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/tideland/RNCL/~4/eWdTiJaQJoc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mue.tideland.biz/feeds/1862502399071774359/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://mue.tideland.biz/2012/02/so-re-started-this-blog.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1862502399071774359" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1862502399071774359" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/tideland/RNCL/~3/eWdTiJaQJoc/so-re-started-this-blog.html" title="Restart of this blog" /><author><name>Frank Müller</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-5TdaFo5OKSw/AAAAAAAAAAI/AAAAAAAADj0/mSKvQL6oors/s512-c/photo.jpg" /></author><thr:total>0</thr:total><georss:featurename>Oldenburg (Oldb), Deutschland</georss:featurename><georss:point>53.147739 8.2106028</georss:point><georss:box>53.0715105 8.0526743 53.2239675 8.3685313</georss:box><feedburner:origLink>http://mue.tideland.biz/2012/02/so-re-started-this-blog.html</feedburner:origLink></entry></feed>

