simple file writing example in google go (golang)

package main

import (
	"fmt"
	"io"
	"os"
)

func main() {

	filename := "test.txt"

	fmt.Println("writing: " + filename)
	f, err := os.Create(filename)
	if err != nil {
		fmt.Println(err)
	}
	n, err := io.WriteString(f, "blahblahblah")
	if err != nil {
		fmt.Println(n, err)
	}
	f.Close()
}
For blog updates and more follow me on twitter.