simple file writing example in google go (golang)

package main

import (

func main() {

	filename := "test.txt"

	fmt.Println("writing: " + filename)
	f, err := os.Create(filename)
	if err != nil {
	n, err := io.WriteString(f, "blahblahblah")
	if err != nil {
		fmt.Println(n, err)

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>