How to Read a file in Go

In go you will sometimes write more code than you are used to in e.g. most higher level languages (think php, ruby, python) - but will have a lot more control over how it is done.

In this instance we read all the lines of a file (the program itself) into memory - using the bufio.Scanner api instead of naively trying to split the input text on e.g. newlines, and return that as an array of strings. Then we loop through these and print them to the console (prefixed by the line number).