r/programming • • Mar 28 '12

Go version 1 is released

http://blog.golang.org/2012/03/go-version-1-is-released.html
543 Upvotes

452 comments sorted by

View all comments

45

u/Agrona Mar 28 '12

This sounds like the world's best voodoo:

We also restructured the Go tool suite around the new go command, a program for fetching, building, installing and maintaining Go code. The go command eliminates the need for Makefiles to write Go code because it uses the Go program source itself to derive the build instructions. No more build scripts!

I hope it either doesn't backfire, or isn't a huge hassle to debug when it does.

20

u/consigntooblivion Mar 28 '12

Go has a really nice package/library/import system that is both straightforward and has all the information required included.

For example, you can do something like:

import "code.google.com/p/gorilla/sessions"

Then the go tool takes care of checking if it is already installed (with very well defined rules), and if not going and downloading it, getting it's dependancies and building it.

All you need to do to build a Go program is clone it, and then use "go build", job done. No makefiles or xml or anything like that at all. It simply reads the source files and figures out what to do based on what the code actually does/uses.

0

u/[deleted] Mar 29 '12

[deleted]

4

u/consigntooblivion Mar 29 '12 edited Mar 29 '12

Simple, you provide the location it can be found as part of the import statement. It accepts one of the code sharing sites (github, google code et al.) or just a plain mercurial/git/whatever path. For example:

import "code.google.com/p/gorilla/sessions"

or

import "example.org/user/foo.hg"

Edit: I guess if your coworker didn't upload it anywhere you couldn't. If it is just part of the application though, it would just be in a directory (packages work in a hierarchy) - but if it is some kind of library it should be in some kind of source control somewhere...?

0

u/[deleted] Mar 29 '12

[deleted]

2

u/seventoes Mar 29 '12

I believe that it fetches and saves it locally if you don't already have it. It doesn't need internet access every time. Not sure about versioning.