Recent Posts

Full Category Index

Posts in “Go”

Three Letter Passwords

Tue, 9 Dec 2014
Three Word - Password Generator Summary I recently created a simple application named uniquely as passgen which was written to generate a random password created from a pool of English three letter words. This gave me a small Golang project to work on, and also to create a handy tool to generate strong passwords. How Does it Work? This application generates password suggestions based on a pool of several hundred three letter English words.

Serving Up Static Content from Golang Apps

Sun, 30 Nov 2014
The Background Go is a great programming language, and three of the features I like the most are: its easy cross platform program creation - write a program on a Linux 64bit system—cross compile easily, and deploy the executable straight onto a Windows 32bit computer (if you so desire of course!); its modern awareness of the web - and therefore inclusion of commonly required application functionality built-in to the language libraries; its static compilation - related to the first one, but key in that it is only the executable that needs to be deployed—no library dependency, DLL hell, or installation packaging needed.

Go Web Server - Why Two Log Outputs?

Sat, 1 Nov 2014
The Go Program Create a very simple Go web server as follows, by saving the following Go code into a file called server.go: package main import ( "io" "log" "net/http" ) // Function Home - that handles a web server request for a page func Home(w http.ResponseWriter, req *http.Request) { // write some text to the calling web browser io.WriteString(w, "Hello World!") // output to the console that we did something log.Println("served a web page") } // Function: MAIN func main() { // start up output - to let us know the web server is starting log.Println("Starting server...") // handler registered for requests to the root of our web server - send them to the function 'Home' http.HandleFunc("/", Home) // start a web server on localhost port 8000 grabbing any errors that occur err := http.ListenAndServe(":8000",nil) // check for any errors from the above web server start-up if err != nil { log.Fatal("ListenAndServer: ", err) } } Assuming you already have Go installed on your computer and configured correctly, the above can be run with: go run server.go The Strange Output?