from genes import apt, brew, pacman, http_downloader, checksum, msiexec
import platform


opsys = platform.system()
dist = platform.linux_distribution()


if platform == 'Linux' and dist == 'Arch':
    pacman.update()
    pacman.sync('go')


if platform == 'Linux' and (dist == 'Debian' or dist == 'Ubuntu'):
    apt.update()
    apt.install('golang')
    # TODO: make this a runner and require a switch to enable this
    apt.install('golang-go-darwin-amd64',
                'golang-go-freebsd-amd64',
                'golang-go-netbsd-amd64',
                'golang-go-windows-amd64')


if platform == 'Darwin':
    brew.update()
    brew.install('go')


if platform == 'Windows':
    installer = http_downloader.get('https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi')
    checksum.check(installer, 'sha1', '0a439f49b546b82f85adf84a79bbf40de2b3d5ba')
    install_flags = ('/qn' '/norestart')
    msiexec.run(installer, install_flags)

@@ -24,53 +24,9 @@
 brew
-, pacman, http_downloader, checksum, msiexec
 %0A
+
 impo
@@ -107,96 +107,24 @@
 ()%0A%0A
-%0Aif platform == 'Linux' and dist == 'Arch':%0A    pacman.update
+def main
 ()
+:
 %0A    
-pacman.sync('go')%0A%0A%0A
 if p
@@ -186,16 +186,20 @@
 untu'):%0A
+    
     apt.
@@ -203,24 +203,28 @@
 pt.update()%0A
+    
     apt.inst
@@ -241,16 +241,20 @@
 g')%0A    
+  
+  
 # TODO: 
@@ -308,16 +308,20 @@
 le this%0A
+    
     apt.
@@ -362,32 +362,36 @@
                 
+  
+  
 'golang-go-freeb
@@ -393,32 +393,36 @@
 freebsd-amd64',%0A
+    
                 
@@ -455,32 +455,36 @@
                 
+    
 'golang-go-windo
@@ -496,370 +496,6 @@
 d64'
-)%0A%0A%0Aif platform == 'Darwin':%0A    brew.update()%0A    brew.install('go')%0A%0A%0Aif platform == 'Windows':%0A    installer = http_downloader.get('https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi')%0A    checksum.check(installer, 'sha1', '0a439f49b546b82f85adf84a79bbf40de2b3d5ba')%0A    install_flags = ('/qn' '/norestart')%0A    msiexec.run(installer, install_flags
 )%0A

Format go a bit