Hello world!

Welcome to WordPress.com! This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Happy blogging!

func main() {
  go printStats()

  tmp := make([]byte, 4096)

  for {
    // Read from stdin
    n, err := os.Stdin.Read(tmp)
    if err == io.EOF {
      break;
    } else if err != nil {
      log.Fatal("An error occurred reading from Stdin.")
    }

    byteCount.add(n)

    // Write to stdout
    if _, err := os.Stdout.Write(tmp[0:n]); err != nil {
      log.Fatal("An error occurred writing to Stdout.")
    }
  }

  // Always finish with a newline character.
  fmt.Fprintln(os.Stderr)
}
Advertisements

3 thoughts on “Hello world!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s