User Tools

Site Tools


plan_9_go_programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
plan_9_go_programming [2022/06/19 03:47] rudiplan_9_go_programming [2023/07/10 20:18] hc9
Line 1: Line 1:
-=== Initial Setup on 9p.sdf.org === 
-To get started with Go, you have to add the variable and bind below to your $home/lib/profile 
-<code> 
- GOROOT=/sys/lib/go 
- bind -qa /sys/lib/go/bin /bin 
-</code> 
  
-=== Testing Your Setup === 
-When you're in a namespace which has Go set up from above you can do a quick test 
-<code> 
-[/usr/rudi] 9p% go version 
-go version go1.18.3 plan9/amd64 
-</code> 
- 
-Or you can do a bit more of a complicated test by saying Hello world! 
-<code> 
-[/usr/rudi] 9p% cat hello.go 
-package main 
- 
-import "fmt" 
- 
-func main() { 
- fmt.Println("Hello plan9!") 
-} 
- 
-[/usr/rudi] 9p% go run hello.go 
-Hello plan9! 
-</code> 
- 
-=== Next Steps === 
-That's really all there is to it for getting started!  
- 
-[[https://quii.gitbook.io/learn-go-with-tests/|Learn Go With Tests]] is extremely useful for learning Go if you're new to the language. 
- 
-=== Go for Plan9 === 
-I'm not sure if there are any Plan9 specific differences for Go. 
-  * If you need help, please feel free to reach out to [[mailto://rudi@sdf.org|rudi@sdf.org]] 
-  * It might be possible to make Golang bindings for Plan9 C functions via [[https://pkg.go.dev/cmd/cgo|cgo]] 
-    * I (rudi@9p) will probably work on this in my free time 
plan_9_go_programming.txt · Last modified: 2023/07/10 20:18 by hc9